Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
36c55adc
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,发现更多精彩内容 >>
提交
36c55adc
编写于
10月 13, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
deco - enable marker decorations but disable them by default
上级
62dab62f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
17 deletion
+23
-17
src/vs/base/browser/ui/iconLabel/iconLabel.ts
src/vs/base/browser/ui/iconLabel/iconLabel.ts
+1
-2
src/vs/workbench/parts/markers/browser/markersFileDecorations.ts
...workbench/parts/markers/browser/markersFileDecorations.ts
+20
-13
src/vs/workbench/parts/markers/markers.contribution.ts
src/vs/workbench/parts/markers/markers.contribution.ts
+1
-1
src/vs/workbench/services/decorations/browser/decorationsService.ts
...kbench/services/decorations/browser/decorationsService.ts
+1
-1
未找到文件。
src/vs/base/browser/ui/iconLabel/iconLabel.ts
浏览文件 @
36c55adc
...
...
@@ -152,12 +152,11 @@ export class IconLabel {
if
(
options
&&
options
.
badge
)
{
if
(
!
this
.
badgeNode
)
{
this
.
badgeNode
=
document
.
createElement
(
'
span
'
);
this
.
badgeNode
.
className
=
'
label-badge
'
;
this
.
element
.
style
.
display
=
'
flex
'
;
this
.
element
.
appendChild
(
this
.
badgeNode
);
}
this
.
badgeNode
.
title
=
options
.
badge
.
title
;
dom
.
addClass
(
this
.
badgeNode
,
options
.
badge
.
className
)
;
this
.
badgeNode
.
className
=
`label-badge
${
options
.
badge
.
className
}
`
;
dom
.
show
(
this
.
badgeNode
);
}
else
if
(
this
.
badgeNode
)
{
...
...
src/vs/workbench/parts/markers/browser/markersFileDecorations.ts
浏览文件 @
36c55adc
...
...
@@ -6,13 +6,12 @@
'
use strict
'
;
import
{
IWorkbenchContribution
,
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
IMarkerService
}
from
'
vs/platform/markers/common/markers
'
;
import
{
IMarkerService
,
IMarker
}
from
'
vs/platform/markers/common/markers
'
;
import
{
IResourceDecorationsService
,
IDecorationsProvider
,
IResourceDecorationData
}
from
'
vs/workbench/services/decorations/browser/decorations
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
Event
from
'
vs/base/common/event
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
isFalsyOrEmpty
}
from
'
vs/base/common/arrays
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
editorErrorForeground
,
editorWarningForeground
}
from
'
vs/editor/common/view/editorColorRegistry
'
;
...
...
@@ -31,18 +30,21 @@ class MarkersDecorationsProvider implements IDecorationsProvider {
}
provideDecorations
(
resource
:
URI
):
IResourceDecorationData
{
let
markers
=
this
.
_markerService
.
read
({
resource
});
let
first
:
IMarker
;
for
(
const
marker
of
markers
)
{
if
(
!
first
||
marker
.
severity
>
first
.
severity
)
{
first
=
marker
;
}
}
const
markers
=
this
.
_markerService
.
read
({
resource
})
.
sort
((
a
,
b
)
=>
Severity
.
compare
(
a
.
severity
,
b
.
severity
));
if
(
isFalsyOrEmpty
(
markers
))
{
if
(
!
first
)
{
return
undefined
;
}
const
[
first
]
=
markers
;
return
{
weight
:
100
*
first
.
severity
,
tooltip
:
localize
(
'
tooltip
'
,
"
{0} problems in this file
"
,
markers
.
length
),
tooltip
:
markers
.
length
===
1
?
localize
(
'
tooltip.1
'
,
"
1 problem in this file
"
)
:
localize
(
'
tooltip.N
'
,
"
{0} problems in this file
"
,
markers
.
length
),
letter
:
markers
.
length
.
toString
(),
color
:
first
.
severity
===
Severity
.
Error
?
editorErrorForeground
:
editorWarningForeground
,
};
...
...
@@ -53,6 +55,7 @@ class MarkersFileDecorations implements IWorkbenchContribution {
private
readonly
_disposables
:
IDisposable
[];
private
_provider
:
IDisposable
;
private
_enabled
:
boolean
;
constructor
(
@
IMarkerService
private
_markerService
:
IMarkerService
,
...
...
@@ -63,7 +66,6 @@ class MarkersFileDecorations implements IWorkbenchContribution {
this
.
_disposables
=
[
this
.
_configurationService
.
onDidUpdateConfiguration
(
this
.
_updateEnablement
,
this
),
];
this
.
_updateEnablement
();
}
...
...
@@ -77,11 +79,16 @@ class MarkersFileDecorations implements IWorkbenchContribution {
}
private
_updateEnablement
():
void
{
let
value
=
this
.
_configurationService
.
getConfiguration
<
{
fileDecorations
:
{
enabled
:
boolean
}
}
>
(
'
problems
'
);
if
(
value
.
fileDecorations
.
enabled
)
{
let
value
=
this
.
_configurationService
.
getConfiguration
<
{
decorations
:
{
enabled
:
boolean
}
}
>
(
'
problems
'
);
if
(
value
.
decorations
.
enabled
===
this
.
_enabled
)
{
return
;
}
this
.
_enabled
=
value
.
decorations
.
enabled
;
if
(
this
.
_enabled
)
{
const
provider
=
new
MarkersDecorationsProvider
(
this
.
_markerService
);
this
.
_provider
=
this
.
_decorationsService
.
registerDecortionsProvider
(
provider
);
}
else
if
(
this
.
_provider
)
{
this
.
_enabled
=
value
.
decorations
.
enabled
;
this
.
_provider
.
dispose
();
}
}
...
...
@@ -94,10 +101,10 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).regis
'
order
'
:
101
,
'
type
'
:
'
object
'
,
'
properties
'
:
{
'
problems.
fileD
ecorations.enabled
'
:
{
'
problems.
d
ecorations.enabled
'
:
{
'
description
'
:
localize
(
'
markers.showOnFile
'
,
"
Show Errors & Warnings on files and folder.
"
),
'
type
'
:
'
boolean
'
,
'
default
'
:
tru
e
'
default
'
:
fals
e
}
}
});
src/vs/workbench/parts/markers/markers.contribution.ts
浏览文件 @
36c55adc
...
...
@@ -5,7 +5,7 @@
import
{
registerContributions
}
from
'
vs/workbench/parts/markers/browser/markersWorkbenchContributions
'
;
import
{
registerContributions
as
registerElectronContributions
}
from
'
vs/workbench/parts/markers/electron-browser/markersElectronContributions
'
;
//
import './browser/markersFileDecorations';
import
'
./browser/markersFileDecorations
'
;
registerContributions
();
registerElectronContributions
();
src/vs/workbench/services/decorations/browser/decorationsService.ts
浏览文件 @
36c55adc
...
...
@@ -309,7 +309,7 @@ export class FileDecorationsService implements IResourceDecorationsService {
for
(
let
iter
=
this
.
_data
.
iterator
(),
next
=
iter
.
next
();
!
next
.
done
;
next
=
iter
.
next
())
{
next
.
value
.
getOrRetrieve
(
uri
,
includeChildren
,
(
candidate
,
isChild
)
=>
{
top
=
FileDecorationsService
.
_pickBest
(
top
,
candidate
);
topIsChild
=
top
===
candidate
&&
isChild
;
topIsChild
=
top
===
candidate
&&
isChild
||
topIsChild
;
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录