Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
329868aa
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
329868aa
编写于
2月 14, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
notifications -
💄
上级
fea2a8f4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
2 deletion
+18
-2
src/vs/workbench/browser/parts/notifications/notificationsAlerts.ts
...kbench/browser/parts/notifications/notificationsAlerts.ts
+8
-0
src/vs/workbench/common/notifications.ts
src/vs/workbench/common/notifications.ts
+10
-2
未找到文件。
src/vs/workbench/browser/parts/notifications/notificationsAlerts.ts
浏览文件 @
329868aa
...
@@ -10,6 +10,7 @@ import { localize } from 'vs/nls';
...
@@ -10,6 +10,7 @@ import { localize } from 'vs/nls';
import
{
Severity
}
from
'
vs/platform/message/common/message
'
;
import
{
Severity
}
from
'
vs/platform/message/common/message
'
;
import
{
INotificationViewItem
,
INotificationsModel
,
NotificationChangeType
,
INotificationChangeEvent
}
from
'
vs/workbench/common/notifications
'
;
import
{
INotificationViewItem
,
INotificationsModel
,
NotificationChangeType
,
INotificationChangeEvent
}
from
'
vs/workbench/common/notifications
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
toErrorMessage
}
from
'
vs/base/common/errorMessage
'
;
export
class
NotificationsAlerts
{
export
class
NotificationsAlerts
{
...
@@ -30,7 +31,14 @@ export class NotificationsAlerts {
...
@@ -30,7 +31,14 @@ export class NotificationsAlerts {
private
onDidNotificationChange
(
e
:
INotificationChangeEvent
):
void
{
private
onDidNotificationChange
(
e
:
INotificationChangeEvent
):
void
{
if
(
e
.
kind
===
NotificationChangeType
.
ADD
)
{
if
(
e
.
kind
===
NotificationChangeType
.
ADD
)
{
// ARIA alert for screen readers
this
.
ariaAlert
(
e
.
item
);
this
.
ariaAlert
(
e
.
item
);
// Always log errors to console with full details
if
(
e
.
item
.
severity
===
Severity
.
Error
)
{
console
.
error
(
toErrorMessage
(
e
.
item
.
message
.
value
,
true
));
}
}
}
}
}
...
...
src/vs/workbench/common/notifications.ts
浏览文件 @
329868aa
...
@@ -13,6 +13,7 @@ import { toErrorMessage } from 'vs/base/common/errorMessage';
...
@@ -13,6 +13,7 @@ import { toErrorMessage } from 'vs/base/common/errorMessage';
import
{
localize
}
from
'
vs/nls
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
Event
,
{
Emitter
,
once
}
from
'
vs/base/common/event
'
;
import
Event
,
{
Emitter
,
once
}
from
'
vs/base/common/event
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
isPromiseCanceledError
}
from
'
vs/base/common/errors
'
;
export
interface
INotificationsModel
{
export
interface
INotificationsModel
{
...
@@ -139,10 +140,17 @@ export class NotificationViewItem implements INotificationViewItem {
...
@@ -139,10 +140,17 @@ export class NotificationViewItem implements INotificationViewItem {
private
_onDidDispose
:
Emitter
<
void
>
;
private
_onDidDispose
:
Emitter
<
void
>
;
public
static
create
(
notification
:
INotification
):
INotificationViewItem
{
public
static
create
(
notification
:
INotification
):
INotificationViewItem
{
if
(
!
notification
||
!
notification
.
message
)
{
if
(
!
notification
||
!
notification
.
message
||
isPromiseCanceledError
(
notification
.
message
)
)
{
return
null
;
// we need a message to show
return
null
;
// we need a message to show
}
}
let
severity
:
Severity
;
if
(
typeof
notification
.
severity
===
'
number
'
)
{
severity
=
notification
.
severity
;
}
else
{
severity
=
Severity
.
Info
;
}
let
message
:
IMarkdownString
;
let
message
:
IMarkdownString
;
if
(
notification
.
message
instanceof
Error
)
{
if
(
notification
.
message
instanceof
Error
)
{
message
=
{
value
:
toErrorMessage
(
notification
.
message
,
false
),
isTrusted
:
true
};
message
=
{
value
:
toErrorMessage
(
notification
.
message
,
false
),
isTrusted
:
true
};
...
@@ -156,7 +164,7 @@ export class NotificationViewItem implements INotificationViewItem {
...
@@ -156,7 +164,7 @@ export class NotificationViewItem implements INotificationViewItem {
return
null
;
// we need a message to show
return
null
;
// we need a message to show
}
}
return
new
NotificationViewItem
(
notification
.
severity
,
message
,
notification
.
source
||
NotificationViewItem
.
DEFAULT_SOURCE
,
notification
.
actions
||
[]);
return
new
NotificationViewItem
(
severity
,
message
,
notification
.
source
||
NotificationViewItem
.
DEFAULT_SOURCE
,
notification
.
actions
||
[]);
}
}
private
constructor
(
private
_severity
:
Severity
,
private
_message
:
IMarkdownString
,
private
_source
:
string
,
private
_actions
:
IAction
[])
{
private
constructor
(
private
_severity
:
Severity
,
private
_message
:
IMarkdownString
,
private
_source
:
string
,
private
_actions
:
IAction
[])
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录