Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
3017bc0f
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,发现更多精彩内容 >>
提交
3017bc0f
编写于
12月 14, 2017
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
git submodule decorations
上级
c8426620
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
1 deletion
+28
-1
extensions/git/package.json
extensions/git/package.json
+9
-0
extensions/git/package.nls.json
extensions/git/package.nls.json
+2
-1
extensions/git/src/decorationProvider.ts
extensions/git/src/decorationProvider.ts
+17
-0
未找到文件。
extensions/git/package.json
浏览文件 @
3017bc0f
...
...
@@ -951,6 +951,15 @@
"dark"
:
"#6c6cc4"
,
"highContrast"
:
"#6c6cc4"
}
},
{
"id"
:
"gitDecoration.submoduleResourceForeground"
,
"description"
:
"%colors.submodule%"
,
"defaults"
:
{
"light"
:
"#1258a7"
,
"dark"
:
"#8db9e2"
,
"highContrast"
:
"#8db9e2"
}
}
]
},
...
...
extensions/git/package.nls.json
浏览文件 @
3017bc0f
...
...
@@ -68,5 +68,6 @@
"colors.deleted"
:
"Color for deleted resources."
,
"colors.untracked"
:
"Color for untracked resources."
,
"colors.ignored"
:
"Color for ignored resources."
,
"colors.conflict"
:
"Color for resources with conflicts."
"colors.conflict"
:
"Color for resources with conflicts."
,
"colors.submodule"
:
"Color for submodule resources."
}
\ No newline at end of file
extensions/git/src/decorationProvider.ts
浏览文件 @
3017bc0f
...
...
@@ -6,10 +6,12 @@
'
use strict
'
;
import
{
window
,
workspace
,
Uri
,
Disposable
,
Event
,
EventEmitter
,
DecorationData
,
DecorationProvider
,
ThemeColor
}
from
'
vscode
'
;
import
*
as
path
from
'
path
'
;
import
{
Repository
,
GitResourceGroup
,
Status
}
from
'
./repository
'
;
import
{
Model
}
from
'
./model
'
;
import
{
debounce
}
from
'
./decorators
'
;
import
{
filterEvent
}
from
'
./util
'
;
import
{
Submodule
}
from
'
./git
'
;
class
GitIgnoreDecorationProvider
implements
DecorationProvider
{
...
...
@@ -65,6 +67,14 @@ class GitIgnoreDecorationProvider implements DecorationProvider {
class
GitDecorationProvider
implements
DecorationProvider
{
private
static
SubmoduleDecorationData
=
{
source
:
'
git.resource
'
,
title
:
'
Submodule
'
,
abbreviation
:
'
S
'
,
color
:
new
ThemeColor
(
'
gitDecoration.submoduleResourceForeground
'
),
priority
:
1
};
private
readonly
_onDidChangeDecorations
=
new
EventEmitter
<
Uri
[]
>
();
readonly
onDidChangeDecorations
:
Event
<
Uri
[]
>
=
this
.
_onDidChangeDecorations
.
event
;
...
...
@@ -83,6 +93,7 @@ class GitDecorationProvider implements DecorationProvider {
this
.
collectDecorationData
(
this
.
repository
.
indexGroup
,
newDecorations
);
this
.
collectDecorationData
(
this
.
repository
.
workingTreeGroup
,
newDecorations
);
this
.
collectDecorationData
(
this
.
repository
.
mergeGroup
,
newDecorations
);
this
.
collectSubmoduleDecorationData
(
newDecorations
);
const
uris
=
new
Set
([...
this
.
decorations
.
keys
()].
concat
([...
newDecorations
.
keys
()]));
this
.
decorations
=
newDecorations
;
...
...
@@ -101,6 +112,12 @@ class GitDecorationProvider implements DecorationProvider {
});
}
private
collectSubmoduleDecorationData
(
bucket
:
Map
<
string
,
DecorationData
>
):
void
{
for
(
const
submodule
of
this
.
repository
.
submodules
)
{
bucket
.
set
(
Uri
.
file
(
path
.
join
(
this
.
repository
.
root
,
submodule
.
path
)).
toString
(),
GitDecorationProvider
.
SubmoduleDecorationData
);
}
}
provideDecoration
(
uri
:
Uri
):
DecorationData
|
undefined
{
return
this
.
decorations
.
get
(
uri
.
toString
());
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录