Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
f61f9602
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f61f9602
编写于
10月 13, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
deco - use weight instead of severity
上级
683b531c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
10 addition
and
15 deletion
+10
-15
src/vs/workbench/parts/markers/browser/markersFileDecorations.ts
...workbench/parts/markers/browser/markersFileDecorations.ts
+1
-1
src/vs/workbench/parts/scm/electron-browser/scmFileDecorations.ts
...orkbench/parts/scm/electron-browser/scmFileDecorations.ts
+1
-2
src/vs/workbench/services/decorations/browser/decorations.ts
src/vs/workbench/services/decorations/browser/decorations.ts
+2
-3
src/vs/workbench/services/decorations/browser/decorationsService.ts
...kbench/services/decorations/browser/decorationsService.ts
+4
-5
src/vs/workbench/services/decorations/test/browser/decorationsService.test.ts
...vices/decorations/test/browser/decorationsService.test.ts
+2
-4
未找到文件。
src/vs/workbench/parts/markers/browser/markersFileDecorations.ts
浏览文件 @
f61f9602
...
@@ -41,7 +41,7 @@ class MarkersDecorationsProvider implements IDecorationsProvider {
...
@@ -41,7 +41,7 @@ class MarkersDecorationsProvider implements IDecorationsProvider {
const
[
first
]
=
markers
;
const
[
first
]
=
markers
;
return
{
return
{
severity
:
first
.
severity
,
weight
:
100
*
first
.
severity
,
tooltip
:
localize
(
'
tooltip
'
,
"
{0} problems in this file
"
,
markers
.
length
),
tooltip
:
localize
(
'
tooltip
'
,
"
{0} problems in this file
"
,
markers
.
length
),
letter
:
markers
.
length
.
toString
(),
letter
:
markers
.
length
.
toString
(),
color
:
first
.
severity
===
Severity
.
Error
?
editorErrorForeground
:
editorWarningForeground
,
color
:
first
.
severity
===
Severity
.
Error
?
editorErrorForeground
:
editorWarningForeground
,
...
...
src/vs/workbench/parts/scm/electron-browser/scmFileDecorations.ts
浏览文件 @
f61f9602
...
@@ -10,7 +10,6 @@ import { IResourceDecorationsService, IDecorationsProvider, IResourceDecorationD
...
@@ -10,7 +10,6 @@ import { IResourceDecorationsService, IDecorationsProvider, IResourceDecorationD
import
{
IDisposable
,
dispose
,
combinedDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
dispose
,
combinedDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ISCMService
,
ISCMRepository
,
ISCMProvider
,
ISCMResource
}
from
'
vs/workbench/services/scm/common/scm
'
;
import
{
ISCMService
,
ISCMRepository
,
ISCMProvider
,
ISCMResource
}
from
'
vs/workbench/services/scm/common/scm
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
localize
}
from
'
vs/nls
'
;
...
@@ -67,7 +66,7 @@ class SCMDecorationsProvider implements IDecorationsProvider {
...
@@ -67,7 +66,7 @@ class SCMDecorationsProvider implements IDecorationsProvider {
return
undefined
;
return
undefined
;
}
}
return
{
return
{
severity
:
Severity
.
Info
,
weight
:
10
,
tooltip
:
localize
(
'
tooltip
'
,
"
{0}, {1}
"
,
resource
.
decorations
.
tooltip
,
this
.
_provider
.
label
),
tooltip
:
localize
(
'
tooltip
'
,
"
{0}, {1}
"
,
resource
.
decorations
.
tooltip
,
this
.
_provider
.
label
),
color
:
resource
.
decorations
.
color
,
color
:
resource
.
decorations
.
color
,
letter
:
resource
.
decorations
.
tooltip
.
charAt
(
0
)
letter
:
resource
.
decorations
.
tooltip
.
charAt
(
0
)
...
...
src/vs/workbench/services/decorations/browser/decorations.ts
浏览文件 @
f61f9602
...
@@ -7,14 +7,13 @@
...
@@ -7,14 +7,13 @@
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
Event
from
'
vs/base/common/event
'
;
import
Event
from
'
vs/base/common/event
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
ColorIdentifier
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
ColorIdentifier
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
export
const
IResourceDecorationsService
=
createDecorator
<
IResourceDecorationsService
>
(
'
IFileDecorationsService
'
);
export
const
IResourceDecorationsService
=
createDecorator
<
IResourceDecorationsService
>
(
'
IFileDecorationsService
'
);
export
interface
IResourceDecorationData
{
export
interface
IResourceDecorationData
{
readonly
severity
:
Severity
;
readonly
weight
?:
number
;
readonly
color
?:
ColorIdentifier
;
readonly
color
?:
ColorIdentifier
;
readonly
opacity
?:
number
;
readonly
opacity
?:
number
;
readonly
letter
?:
string
;
readonly
letter
?:
string
;
...
@@ -23,7 +22,7 @@ export interface IResourceDecorationData {
...
@@ -23,7 +22,7 @@ export interface IResourceDecorationData {
export
interface
IResourceDecoration
{
export
interface
IResourceDecoration
{
readonly
_decoBrand
:
undefined
;
readonly
_decoBrand
:
undefined
;
readonly
severity
:
Severity
;
readonly
weight
?:
number
;
readonly
tooltip
?:
string
;
readonly
tooltip
?:
string
;
readonly
labelClassName
?:
string
;
readonly
labelClassName
?:
string
;
readonly
badgeClassName
?:
string
;
readonly
badgeClassName
?:
string
;
...
...
src/vs/workbench/services/decorations/browser/decorationsService.ts
浏览文件 @
f61f9602
...
@@ -5,7 +5,6 @@
...
@@ -5,7 +5,6 @@
'
use strict
'
;
'
use strict
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
Event
,
{
Emitter
,
debounceEvent
,
any
}
from
'
vs/base/common/event
'
;
import
Event
,
{
Emitter
,
debounceEvent
,
any
}
from
'
vs/base/common/event
'
;
import
{
IResourceDecorationsService
,
IResourceDecoration
,
IResourceDecorationChangeEvent
,
IDecorationsProvider
,
IResourceDecorationData
}
from
'
./decorations
'
;
import
{
IResourceDecorationsService
,
IResourceDecoration
,
IResourceDecorationChangeEvent
,
IDecorationsProvider
,
IResourceDecorationData
}
from
'
./decorations
'
;
import
{
TernarySearchTree
}
from
'
vs/base/common/map
'
;
import
{
TernarySearchTree
}
from
'
vs/base/common/map
'
;
...
@@ -57,14 +56,14 @@ class ResourceDecoration implements IResourceDecoration {
...
@@ -57,14 +56,14 @@ class ResourceDecoration implements IResourceDecoration {
_decoBrand
:
undefined
;
_decoBrand
:
undefined
;
_key
:
string
;
_key
:
string
;
severity
:
Severity
;
weight
?:
number
;
tooltip
?:
string
;
tooltip
?:
string
;
labelClassName
?:
string
;
labelClassName
?:
string
;
badgeClassName
?:
string
;
badgeClassName
?:
string
;
constructor
(
key
:
string
,
data
:
IResourceDecorationData
)
{
constructor
(
key
:
string
,
data
:
IResourceDecorationData
)
{
this
.
_key
=
key
;
this
.
_key
=
key
;
this
.
severity
=
data
.
severity
;
this
.
weight
=
data
.
weight
;
this
.
tooltip
=
data
.
tooltip
;
this
.
tooltip
=
data
.
tooltip
;
}
}
}
}
...
@@ -317,7 +316,7 @@ export class FileDecorationsService implements IResourceDecorationsService {
...
@@ -317,7 +316,7 @@ export class FileDecorationsService implements IResourceDecorationsService {
// only bubble up color
// only bubble up color
top
=
{
top
=
{
_decoBrand
:
undefined
,
_decoBrand
:
undefined
,
severity
:
top
.
severity
,
weight
:
top
.
weight
,
labelClassName
:
top
.
labelClassName
labelClassName
:
top
.
labelClassName
};
};
}
}
...
@@ -331,7 +330,7 @@ export class FileDecorationsService implements IResourceDecorationsService {
...
@@ -331,7 +330,7 @@ export class FileDecorationsService implements IResourceDecorationsService {
return
b
;
return
b
;
}
else
if
(
!
b
)
{
}
else
if
(
!
b
)
{
return
a
;
return
a
;
}
else
if
(
Severity
.
compare
(
a
.
severity
,
b
.
severity
)
<
0
)
{
}
else
if
(
a
.
weight
>
b
.
weight
)
{
return
a
;
return
a
;
}
else
{
}
else
{
return
b
;
return
b
;
...
...
src/vs/workbench/services/decorations/test/browser/decorationsService.test.ts
浏览文件 @
f61f9602
...
@@ -10,7 +10,6 @@ import { FileDecorationsService } from 'vs/workbench/services/decorations/browse
...
@@ -10,7 +10,6 @@ import { FileDecorationsService } from 'vs/workbench/services/decorations/browse
import
{
IDecorationsProvider
,
IResourceDecorationData
}
from
'
vs/workbench/services/decorations/browser/decorations
'
;
import
{
IDecorationsProvider
,
IResourceDecorationData
}
from
'
vs/workbench/services/decorations/browser/decorations
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
Event
,
{
toPromise
}
from
'
vs/base/common/event
'
;
import
Event
,
{
toPromise
}
from
'
vs/base/common/event
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
TestThemeService
}
from
'
vs/platform/theme/test/common/testThemeService
'
;
import
{
TestThemeService
}
from
'
vs/platform/theme/test/common/testThemeService
'
;
suite
(
'
DecorationsService
'
,
function
()
{
suite
(
'
DecorationsService
'
,
function
()
{
...
@@ -36,7 +35,6 @@ suite('DecorationsService', function () {
...
@@ -36,7 +35,6 @@ suite('DecorationsService', function () {
callCounter
+=
1
;
callCounter
+=
1
;
return
new
Promise
<
IResourceDecorationData
>
(
resolve
=>
{
return
new
Promise
<
IResourceDecorationData
>
(
resolve
=>
{
setTimeout
(()
=>
resolve
({
setTimeout
(()
=>
resolve
({
severity
:
Severity
.
Info
,
color
:
'
someBlue
'
,
color
:
'
someBlue
'
,
tooltip
:
'
T
'
tooltip
:
'
T
'
}));
}));
...
@@ -68,7 +66,7 @@ suite('DecorationsService', function () {
...
@@ -68,7 +66,7 @@ suite('DecorationsService', function () {
readonly
onDidChange
:
Event
<
URI
[]
>
=
Event
.
None
;
readonly
onDidChange
:
Event
<
URI
[]
>
=
Event
.
None
;
provideDecorations
(
uri
:
URI
)
{
provideDecorations
(
uri
:
URI
)
{
callCounter
+=
1
;
callCounter
+=
1
;
return
{
severity
:
Severity
.
Info
,
color
:
'
someBlue
'
,
tooltip
:
'
Z
'
};
return
{
color
:
'
someBlue
'
,
tooltip
:
'
Z
'
};
}
}
});
});
...
@@ -86,7 +84,7 @@ suite('DecorationsService', function () {
...
@@ -86,7 +84,7 @@ suite('DecorationsService', function () {
readonly
onDidChange
:
Event
<
URI
[]
>
=
Event
.
None
;
readonly
onDidChange
:
Event
<
URI
[]
>
=
Event
.
None
;
provideDecorations
(
uri
:
URI
)
{
provideDecorations
(
uri
:
URI
)
{
callCounter
+=
1
;
callCounter
+=
1
;
return
{
severity
:
Severity
.
Info
,
color
:
'
someBlue
'
,
tooltip
:
'
J
'
};
return
{
color
:
'
someBlue
'
,
tooltip
:
'
J
'
};
}
}
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录