Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4d07969c
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,发现更多精彩内容 >>
提交
4d07969c
编写于
8月 11, 2016
作者:
F
Fabian Lauer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ignore untracked in git change count badge
上级
1fad0d58
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
4 deletion
+21
-4
src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts
.../workbench/parts/git/browser/gitWorkbenchContributions.ts
+20
-4
src/vs/workbench/parts/git/common/git.ts
src/vs/workbench/parts/git/common/git.ts
+1
-0
未找到文件。
src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts
浏览文件 @
4d07969c
...
...
@@ -26,6 +26,7 @@ import output = require('vs/workbench/parts/output/common/output');
import
{
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
import
{
EditorBrowserRegistry
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
confregistry
=
require
(
'
vs/platform/configuration/common/configurationRegistry
'
);
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
quickopen
=
require
(
'
vs/workbench/browser/quickopen
'
);
import
editorcontrib
=
require
(
'
vs/workbench/parts/git/browser/gitEditorContributions
'
);
import
{
IActivityService
,
ProgressBadge
,
NumberBadge
}
from
'
vs/workbench/services/activity/common/activityService
'
;
...
...
@@ -52,6 +53,7 @@ export class StatusUpdater implements ext.IWorkbenchContribution
private
eventService
:
IEventService
;
private
activityService
:
IActivityService
;
private
messageService
:
IMessageService
;
private
configurationService
:
IConfigurationService
;
private
progressBadgeDelayer
:
async
.
Delayer
<
void
>
;
private
toDispose
:
lifecycle
.
IDisposable
[];
...
...
@@ -59,12 +61,14 @@ export class StatusUpdater implements ext.IWorkbenchContribution
@
IGitService
gitService
:
IGitService
,
@
IEventService
eventService
:
IEventService
,
@
IActivityService
activityService
:
IActivityService
,
@
IMessageService
messageService
:
IMessageService
@
IMessageService
messageService
:
IMessageService
,
@
IConfigurationService
configurationService
:
IConfigurationService
)
{
this
.
gitService
=
gitService
;
this
.
eventService
=
eventService
;
this
.
activityService
=
activityService
;
this
.
messageService
=
messageService
;
this
.
configurationService
=
configurationService
;
this
.
progressBadgeDelayer
=
new
async
.
Delayer
<
void
>
(
200
);
...
...
@@ -86,9 +90,21 @@ export class StatusUpdater implements ext.IWorkbenchContribution
}
private
showChangesBadge
():
void
{
var
count
=
this
.
gitService
.
getModel
().
getStatus
().
getGroups
().
map
((
g1
:
git
.
IStatusGroup
)
=>
{
return
g1
.
all
().
length
;
}).
reduce
((
a
,
b
)
=>
a
+
b
,
0
);
const
config
=
this
.
configurationService
.
getConfiguration
<
git
.
IGitConfiguration
>
(
'
git
'
);
// only use the filter version of the map callback if filtering by file status is really necessary
var
mapper
=
(
g1
:
git
.
IStatusGroup
)
=>
{
return
g1
.
all
().
filter
((
f1
:
git
.
IFileStatus
)
=>
{
return
f1
.
getStatus
()
!==
git
.
Status
.
UNTRACKED
;
}).
length
;
};
// no need to filter by file status if we count both tracked and untracked files
if
(
config
.
countUntracked
)
{
mapper
=
(
g1
:
git
.
IStatusGroup
)
=>
g1
.
all
().
length
;
}
var
count
=
this
.
gitService
.
getModel
().
getStatus
().
getGroups
().
map
(
mapper
).
reduce
((
a
,
b
)
=>
a
+
b
,
0
);
var
badge
=
new
NumberBadge
(
count
,
(
num
)
=>
{
return
nls
.
localize
(
'
gitPendingChangesBadge
'
,
'
{0} pending changes
'
,
num
);
});
...
...
src/vs/workbench/parts/git/common/git.ts
浏览文件 @
4d07969c
...
...
@@ -235,6 +235,7 @@ export interface IGitConfiguration {
enableLongCommitWarning
:
boolean
;
allowLargeRepositories
:
boolean
;
confirmSync
:
boolean
;
countUntracked
:
boolean
;
}
// Service interfaces
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录