Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
0658244f
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,发现更多精彩内容 >>
提交
0658244f
编写于
4月 25, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
show extension name in tooltip, #18066
上级
2d642399
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
39 addition
and
16 deletion
+39
-16
src/vs/base/browser/ui/octiconLabel/octiconLabel.ts
src/vs/base/browser/ui/octiconLabel/octiconLabel.ts
+4
-0
src/vs/workbench/services/progress/browser/progressService2.ts
...s/workbench/services/progress/browser/progressService2.ts
+35
-16
未找到文件。
src/vs/base/browser/ui/octiconLabel/octiconLabel.ts
浏览文件 @
0658244f
...
@@ -28,4 +28,8 @@ export class OcticonLabel {
...
@@ -28,4 +28,8 @@ export class OcticonLabel {
innerHTML
=
expand
(
innerHTML
);
innerHTML
=
expand
(
innerHTML
);
this
.
_container
.
innerHTML
=
innerHTML
;
this
.
_container
.
innerHTML
=
innerHTML
;
}
}
set
title
(
title
:
string
)
{
this
.
_container
.
title
=
title
;
}
}
}
src/vs/workbench/services/progress/browser/progressService2.ts
浏览文件 @
0658244f
...
@@ -6,9 +6,10 @@
...
@@ -6,9 +6,10 @@
import
'
vs/css!vs/workbench/services/progress/browser/media/progressService2
'
;
import
'
vs/css!vs/workbench/services/progress/browser/media/progressService2
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
IActivityBarService
,
ProgressBadge
}
from
'
vs/workbench/services/activity/common/activityBarService
'
;
import
{
IActivityBarService
,
ProgressBadge
}
from
'
vs/workbench/services/activity/common/activityBarService
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IProgressService2
,
IProgressOptions
,
ProgressLocation
,
IProgress
,
Progress
,
emptyProgress
}
from
'
vs/platform/progress/common/progress
'
;
import
{
IProgressService2
,
IProgressOptions
,
ProgressLocation
,
IProgress
,
IProgressStep
,
Progress
,
emptyProgress
}
from
'
vs/platform/progress/common/progress
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/browser/viewlet
'
;
import
{
OcticonLabel
}
from
'
vs/base/browser/ui/octiconLabel/octiconLabel
'
;
import
{
OcticonLabel
}
from
'
vs/base/browser/ui/octiconLabel/octiconLabel
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
...
@@ -39,6 +40,10 @@ class WindowProgressItem implements IStatusbarItem {
...
@@ -39,6 +40,10 @@ class WindowProgressItem implements IStatusbarItem {
this
.
_label
.
text
=
value
;
this
.
_label
.
text
=
value
;
}
}
set
title
(
value
:
string
)
{
this
.
_label
.
title
=
value
;
}
hide
()
{
hide
()
{
dom
.
hide
(
this
.
_element
);
dom
.
hide
(
this
.
_element
);
}
}
...
@@ -48,17 +53,12 @@ class WindowProgressItem implements IStatusbarItem {
...
@@ -48,17 +53,12 @@ class WindowProgressItem implements IStatusbarItem {
}
}
}
}
interface
IWindowProgressTask
{
title
:
string
;
progress
:
Progress
<
string
>
;
}
export
class
ProgressService2
implements
IProgressService2
{
export
class
ProgressService2
implements
IProgressService2
{
_serviceBrand
:
any
;
_serviceBrand
:
any
;
private
_stack
:
IWindowProgressTask
[]
=
[];
private
_stack
:
[
IProgressOptions
,
Progress
<
IProgressStep
>
]
[]
=
[];
constructor
(
constructor
(
@
IActivityBarService
private
_activityBar
:
IActivityBarService
,
@
IActivityBarService
private
_activityBar
:
IActivityBarService
,
...
@@ -84,12 +84,9 @@ export class ProgressService2 implements IProgressService2 {
...
@@ -84,12 +84,9 @@ export class ProgressService2 implements IProgressService2 {
private
_withWindowProgress
(
options
:
IProgressOptions
,
callback
:
(
progress
:
IProgress
<
{
message
?:
string
,
percentage
?:
number
}
>
)
=>
TPromise
<
any
>
):
void
{
private
_withWindowProgress
(
options
:
IProgressOptions
,
callback
:
(
progress
:
IProgress
<
{
message
?:
string
,
percentage
?:
number
}
>
)
=>
TPromise
<
any
>
):
void
{
const
task
=
{
const
task
:
[
IProgressOptions
,
Progress
<
IProgressStep
>
]
=
[
options
,
new
Progress
<
IProgressStep
>
(()
=>
this
.
_updateWindowProgress
())];
progress
:
new
Progress
<
string
>
(()
=>
this
.
_updateWindowProgress
()),
title
:
options
.
title
};
const
promise
=
callback
(
task
.
progress
);
const
promise
=
callback
(
task
[
1
]
);
this
.
_stack
.
unshift
(
task
);
this
.
_stack
.
unshift
(
task
);
this
.
_updateWindowProgress
();
this
.
_updateWindowProgress
();
...
@@ -100,12 +97,34 @@ export class ProgressService2 implements IProgressService2 {
...
@@ -100,12 +97,34 @@ export class ProgressService2 implements IProgressService2 {
});
});
}
}
private
_updateWindowProgress
()
{
private
_updateWindowProgress
(
idx
:
number
=
0
)
{
if
(
this
.
_stack
.
length
===
0
)
{
if
(
idx
>=
this
.
_stack
.
length
)
{
WindowProgressItem
.
Instance
.
hide
();
WindowProgressItem
.
Instance
.
hide
();
}
else
{
}
else
{
const
{
title
,
progress
}
=
this
.
_stack
[
0
];
const
[
options
,
progress
]
=
this
.
_stack
[
idx
];
WindowProgressItem
.
Instance
.
text
=
progress
.
value
||
title
||
'
<missing title or progress message>
'
;
let
text
=
options
.
title
;
if
(
progress
.
value
&&
progress
.
value
.
message
)
{
if
(
options
.
title
)
{
text
=
localize
(
'
progress.text
'
,
"
{0} - {1}
"
,
progress
.
value
.
message
,
options
.
title
);
}
else
{
text
=
progress
.
value
.
message
;
}
}
if
(
!
text
)
{
// no message -> no progress. try with next on stack
this
.
_updateWindowProgress
(
idx
+
1
);
return
;
}
let
title
=
text
;
if
(
options
.
tooltip
)
{
title
=
localize
(
'
progress.title
'
,
"
{0}: {1}
"
,
options
.
tooltip
,
text
);
}
WindowProgressItem
.
Instance
.
text
=
text
;
WindowProgressItem
.
Instance
.
title
=
title
;
WindowProgressItem
.
Instance
.
show
();
WindowProgressItem
.
Instance
.
show
();
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录