Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
0ed7b0e7
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,发现更多精彩内容 >>
提交
0ed7b0e7
编写于
8月 15, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename abbreviation to letter, #54938
上级
5a25b69e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
11 deletion
+19
-11
extensions/git/src/decorationProvider.ts
extensions/git/src/decorationProvider.ts
+1
-1
extensions/git/src/repository.ts
extensions/git/src/repository.ts
+2
-2
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+3
-3
src/vs/workbench/api/node/extHostDecorations.ts
src/vs/workbench/api/node/extHostDecorations.ts
+13
-5
未找到文件。
extensions/git/src/decorationProvider.ts
浏览文件 @
0ed7b0e7
...
...
@@ -93,7 +93,7 @@ class GitDecorationProvider implements DecorationProvider {
private
static
SubmoduleDecorationData
:
DecorationData
=
{
title
:
'
Submodule
'
,
abbreviation
:
'
S
'
,
letter
:
'
S
'
,
color
:
new
ThemeColor
(
'
gitDecoration.submoduleResourceForeground
'
)
};
...
...
extensions/git/src/repository.ts
浏览文件 @
0ed7b0e7
...
...
@@ -259,10 +259,10 @@ export class Resource implements SourceControlResourceState {
get
resourceDecoration
():
DecorationData
{
const
title
=
this
.
tooltip
;
const
abbreviation
=
this
.
letter
;
const
letter
=
this
.
letter
;
const
color
=
this
.
color
;
const
priority
=
this
.
priority
;
return
{
bubble
:
true
,
source
:
'
git.resource
'
,
title
,
abbreviation
,
color
,
priority
};
return
{
bubble
:
true
,
source
:
'
git.resource
'
,
title
,
letter
,
color
,
priority
};
}
constructor
(
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
0ed7b0e7
...
...
@@ -357,11 +357,11 @@ declare module 'vscode' {
//todo@joh -> make class
export
interface
DecorationData
{
letter
:
string
;
title
:
string
;
color
?:
ThemeColor
;
priority
?:
number
;
title
?:
string
;
bubble
?:
boolean
;
abbreviation
?:
string
;
// letter, not optional
color
?:
ThemeColor
;
source
?:
string
;
// hacky... we should remove it and use equality under the hood
}
...
...
src/vs/workbench/api/node/extHostDecorations.ts
浏览文件 @
0ed7b0e7
...
...
@@ -11,11 +11,16 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
Disposable
}
from
'
vs/workbench/api/node/extHostTypes
'
;
import
{
asWinJsPromise
}
from
'
vs/base/common/async
'
;
interface
ProviderData
{
provider
:
vscode
.
DecorationProvider
;
extensionId
:
string
;
}
export
class
ExtHostDecorations
implements
ExtHostDecorationsShape
{
private
static
_handlePool
=
0
;
private
readonly
_provider
=
new
Map
<
number
,
vscode
.
DecorationProvider
>
();
private
readonly
_provider
=
new
Map
<
number
,
ProviderData
>
();
private
readonly
_proxy
:
MainThreadDecorationsShape
;
constructor
(
mainContext
:
IMainContext
)
{
...
...
@@ -24,7 +29,7 @@ export class ExtHostDecorations implements ExtHostDecorationsShape {
registerDecorationProvider
(
provider
:
vscode
.
DecorationProvider
,
extensionId
:
string
):
vscode
.
Disposable
{
const
handle
=
ExtHostDecorations
.
_handlePool
++
;
this
.
_provider
.
set
(
handle
,
provider
);
this
.
_provider
.
set
(
handle
,
{
provider
,
extensionId
}
);
this
.
_proxy
.
$registerDecorationProvider
(
handle
,
extensionId
);
const
listener
=
provider
.
onDidChangeDecorations
(
e
=>
{
...
...
@@ -42,13 +47,16 @@ export class ExtHostDecorations implements ExtHostDecorationsShape {
const
result
:
DecorationReply
=
Object
.
create
(
null
);
return
TPromise
.
join
(
requests
.
map
(
request
=>
{
const
{
handle
,
uri
,
id
}
=
request
;
const
provider
=
this
.
_provider
.
get
(
handle
);
if
(
!
provider
)
{
if
(
!
this
.
_provider
.
has
(
handle
))
{
// might have been unregistered in the meantime
return
void
0
;
}
const
{
provider
,
extensionId
}
=
this
.
_provider
.
get
(
handle
);
return
asWinJsPromise
(
token
=>
provider
.
provideDecoration
(
URI
.
revive
(
uri
),
token
)).
then
(
data
=>
{
result
[
id
]
=
data
&&
<
DecorationData
>
[
data
.
priority
,
data
.
bubble
,
data
.
title
,
data
.
abbreviation
,
data
.
color
,
data
.
source
];
if
(
!
data
.
letter
||
data
.
letter
.
length
!==
1
)
{
console
.
warn
(
`INVALID decoration from extension '
${
extensionId
}
'. The 'letter' must be set and be one character`
);
}
result
[
id
]
=
data
&&
<
DecorationData
>
[
data
.
priority
,
data
.
bubble
,
data
.
title
,
data
.
letter
,
data
.
color
,
data
.
source
];
},
err
=>
{
console
.
error
(
err
);
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录