Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5a57f27d
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,发现更多精彩内容 >>
提交
5a57f27d
编写于
10月 06, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine interfaces
上级
737f55bb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
32 deletion
+21
-32
src/vs/workbench/parts/markers/browser/markersFileDecorations.ts
...workbench/parts/markers/browser/markersFileDecorations.ts
+4
-8
src/vs/workbench/parts/scm/electron-browser/scmFileDecorations.ts
...orkbench/parts/scm/electron-browser/scmFileDecorations.ts
+3
-4
src/vs/workbench/services/fileDecorations/browser/fileDecorations.ts
...bench/services/fileDecorations/browser/fileDecorations.ts
+8
-13
src/vs/workbench/services/fileDecorations/browser/fileDecorationsService.ts
...ervices/fileDecorations/browser/fileDecorationsService.ts
+6
-7
未找到文件。
src/vs/workbench/parts/markers/browser/markersFileDecorations.ts
浏览文件 @
5a57f27d
...
...
@@ -61,19 +61,15 @@ class MarkersFileDecorations implements IWorkbenchContribution {
const
markers
=
this
.
_markerService
.
read
({
resource
})
.
sort
((
a
,
b
)
=>
Severity
.
compare
(
a
.
severity
,
b
.
severity
));
if
(
!
isFalsyOrEmpty
(
markers
))
{
const
data
=
this
.
_toFileDecorationData
(
markers
[
0
]);
this
.
_decorationsService
.
setFileDecoration
(
this
.
_type
,
resource
,
data
);
}
else
{
this
.
_decorationsService
.
unsetFileDecoration
(
this
.
_type
,
resource
);
}
const
data
=
!
isFalsyOrEmpty
(
markers
)
?
this
.
_toFileDecorationData
(
markers
[
0
])
:
undefined
;
this
.
_decorationsService
.
setFileDecoration
(
this
.
_type
,
resource
,
data
);
}
}
private
_toFileDecorationData
(
marker
:
IMarker
):
IFileDecorationData
{
const
{
message
,
severity
}
=
marker
;
const
{
severity
}
=
marker
;
const
color
=
severity
===
Severity
.
Error
?
editorErrorForeground
:
editorWarningForeground
;
return
{
message
,
severity
,
color
};
return
{
severity
,
color
};
}
}
...
...
src/vs/workbench/parts/scm/electron-browser/scmFileDecorations.ts
浏览文件 @
5a57f27d
...
...
@@ -15,7 +15,6 @@ import Severity from 'vs/base/common/severity';
export
class
FileDecorations
implements
IWorkbenchContribution
{
private
readonly
_disposables
:
IDisposable
[];
// private readonly _type: DecorationType;
private
readonly
_repositoryListeners
=
new
Map
<
ISCMRepository
,
IDisposable
>
();
constructor
(
...
...
@@ -50,8 +49,8 @@ export class FileDecorations implements IWorkbenchContribution {
this
.
_decorationsService
.
setFileDecoration
(
type
,
resource
.
sourceUri
,
{
severity
:
Severity
.
Info
,
message
:
resource
.
decorations
.
tooltip
,
color
:
resource
.
decorations
.
color
color
:
resource
.
decorations
.
color
,
icon
:
{
light
:
resource
.
decorations
.
icon
,
dark
:
resource
.
decorations
.
iconDark
}
});
newDecorations
.
set
(
resource
.
sourceUri
.
toString
(),
resource
.
sourceUri
);
}
...
...
@@ -59,7 +58,7 @@ export class FileDecorations implements IWorkbenchContribution {
oldDecorations
.
forEach
((
value
,
key
)
=>
{
if
(
!
newDecorations
.
has
(
key
))
{
this
.
_decorationsService
.
un
setFileDecoration
(
type
,
value
);
this
.
_decorationsService
.
setFileDecoration
(
type
,
value
);
}
});
...
...
src/vs/workbench/services/fileDecorations/browser/fileDecorations.ts
浏览文件 @
5a57f27d
...
...
@@ -12,13 +12,6 @@ import { ColorIdentifier } from 'vs/platform/theme/common/colorRegistry';
export
const
IFileDecorationsService
=
createDecorator
<
IFileDecorationsService
>
(
'
IFileDecorationsService
'
);
export
interface
IFileDecoration
{
readonly
type
:
DecorationType
;
readonly
message
:
string
;
readonly
color
:
ColorIdentifier
;
readonly
severity
:
Severity
;
}
export
abstract
class
DecorationType
{
readonly
label
:
string
;
protected
constructor
(
label
:
string
)
{
...
...
@@ -29,10 +22,14 @@ export abstract class DecorationType {
}
}
export
interface
IFileDecoration
extends
IFileDecorationData
{
readonly
type
:
DecorationType
;
}
export
interface
IFileDecorationData
{
message
:
string
;
color
:
ColorIdentifier
;
severity
:
Severity
;
readonly
severity
:
Severity
;
readonly
color
?
:
ColorIdentifier
;
readonly
icon
?:
URI
|
{
dark
:
URI
,
light
:
URI
}
;
}
export
interface
IFileDecorationsService
{
...
...
@@ -43,9 +40,7 @@ export interface IFileDecorationsService {
registerDecorationType
(
label
:
string
):
DecorationType
;
setFileDecoration
(
type
:
DecorationType
,
target
:
URI
,
data
:
IFileDecorationData
):
void
;
unsetFileDecoration
(
type
:
DecorationType
,
target
:
URI
):
void
;
setFileDecoration
(
type
:
DecorationType
,
target
:
URI
,
data
?:
IFileDecorationData
):
void
;
getDecorations
(
uri
:
URI
,
includeChildren
:
boolean
):
IFileDecoration
[];
...
...
src/vs/workbench/services/fileDecorations/browser/fileDecorationsService.ts
浏览文件 @
5a57f27d
...
...
@@ -46,13 +46,12 @@ export class FileDecorationsService implements IFileDecorationsService {
return
type
;
}
setFileDecoration
(
type
:
DecorationType
,
target
:
URI
,
data
:
IFileDecorationData
):
void
{
this
.
_types
.
get
(
type
).
set
(
target
.
toString
(),
{
type
,
...
data
});
this
.
_onDidChangeFileDecoration
.
fire
(
target
);
}
unsetFileDecoration
(
type
:
DecorationType
,
target
:
URI
):
void
{
this
.
_types
.
get
(
type
).
delete
(
target
.
toString
());
setFileDecoration
(
type
:
DecorationType
,
target
:
URI
,
data
?:
IFileDecorationData
):
void
{
if
(
data
)
{
this
.
_types
.
get
(
type
).
set
(
target
.
toString
(),
{
type
,
...
data
});
}
else
{
this
.
_types
.
get
(
type
).
delete
(
target
.
toString
());
}
this
.
_onDidChangeFileDecoration
.
fire
(
target
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录