Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
747c1018
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,发现更多精彩内容 >>
提交
747c1018
编写于
6月 11, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #50730
上级
41729b45
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
22 deletion
+20
-22
src/vs/workbench/api/browser/viewsExtensionPoint.ts
src/vs/workbench/api/browser/viewsExtensionPoint.ts
+1
-14
src/vs/workbench/browser/parts/views/customView.ts
src/vs/workbench/browser/parts/views/customView.ts
+6
-6
src/vs/workbench/common/views.ts
src/vs/workbench/common/views.ts
+1
-1
src/vs/workbench/services/progress/browser/progressService2.ts
...s/workbench/services/progress/browser/progressService2.ts
+10
-0
src/vs/workbench/services/progress/common/progress.ts
src/vs/workbench/services/progress/common/progress.ts
+2
-1
未找到文件。
src/vs/workbench/api/browser/viewsExtensionPoint.ts
浏览文件 @
747c1018
...
...
@@ -17,7 +17,6 @@ import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWo
import
{
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ProgressLocation
}
from
'
vs/workbench/services/progress/common/progress
'
;
import
{
VIEWLET_ID
as
EXPLORER
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
VIEWLET_ID
as
SCM
}
from
'
vs/workbench/parts/scm/common/scm
'
;
import
{
VIEWLET_ID
as
DEBUG
}
from
'
vs/workbench/parts/debug/common/debug
'
;
...
...
@@ -133,7 +132,7 @@ class ViewsContainersExtensionHandler implements IWorkbenchContribution {
when
:
ContextKeyExpr
.
deserialize
(
item
.
when
),
canToggleVisibility
:
true
,
collapsed
:
this
.
showCollapsed
(
container
),
treeViewer
:
this
.
instantiationService
.
createInstance
(
CustomTreeViewer
,
item
.
id
,
this
.
getProgressLocation
(
container
)
)
treeViewer
:
this
.
instantiationService
.
createInstance
(
CustomTreeViewer
,
item
.
id
,
container
)
};
viewIds
.
push
(
viewDescriptor
.
id
);
...
...
@@ -145,18 +144,6 @@ class ViewsContainersExtensionHandler implements IWorkbenchContribution {
});
}
private
getProgressLocation
(
container
:
ViewContainer
):
ProgressLocation
{
switch
(
container
.
id
)
{
case
EXPLORER
:
return
ProgressLocation
.
Explorer
;
case
SCM
:
return
ProgressLocation
.
Scm
;
case
DEBUG
:
return
null
/* No debug progress location yet */
;
}
return
null
;
}
private
isValidViewDescriptors
(
viewDescriptors
:
IUserFriendlyViewDescriptor
[],
collector
:
ExtensionMessageCollector
):
boolean
{
if
(
!
Array
.
isArray
(
viewDescriptors
))
{
collector
.
error
(
localize
(
'
requirearray
'
,
"
views must be an array
"
));
...
...
src/vs/workbench/browser/parts/views/customView.ts
浏览文件 @
747c1018
...
...
@@ -14,11 +14,11 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView
import
{
IMenuService
,
MenuId
,
MenuItemAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
ContextAwareMenuItemActionItem
,
fillInActionBarActions
,
fillInContextMenuActions
}
from
'
vs/platform/actions/browser/menuItemActionItem
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IViewsService
,
ITreeViewer
,
ITreeItem
,
TreeItemCollapsibleState
,
ITreeViewDataProvider
,
TreeViewItemHandleArg
,
ICustomViewDescriptor
,
ViewsRegistry
}
from
'
vs/workbench/common/views
'
;
import
{
IViewsService
,
ITreeViewer
,
ITreeItem
,
TreeItemCollapsibleState
,
ITreeViewDataProvider
,
TreeViewItemHandleArg
,
ICustomViewDescriptor
,
ViewsRegistry
,
ViewContainer
}
from
'
vs/workbench/common/views
'
;
import
{
IViewletViewOptions
,
FileIconThemableWorkbenchTree
}
from
'
vs/workbench/browser/parts/views/viewsViewlet
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
IProgressService2
,
ProgressLocation
}
from
'
vs/workbench/services/progress/common/progress
'
;
import
{
IProgressService2
}
from
'
vs/workbench/services/progress/common/progress
'
;
import
{
IExtensionService
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
IWorkbenchThemeService
}
from
'
vs/workbench/services/themes/common/workbenchThemeService
'
;
import
{
ICommandService
}
from
'
vs/platform/commands/common/commands
'
;
...
...
@@ -194,7 +194,7 @@ export class CustomTreeViewer extends Disposable implements ITreeViewer {
constructor
(
private
id
:
string
,
private
progressLocation
:
ProgressLocation
,
private
container
:
ViewContainer
,
@
IExtensionService
private
extensionService
:
IExtensionService
,
@
IWorkbenchThemeService
private
themeService
:
IWorkbenchThemeService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
...
...
@@ -292,7 +292,7 @@ export class CustomTreeViewer extends Disposable implements ITreeViewer {
this
.
treeContainer
=
DOM
.
$
(
'
.tree-explorer-viewlet-tree-view
'
);
const
actionItemProvider
=
(
action
:
IAction
)
=>
action
instanceof
MenuItemAction
?
this
.
instantiationService
.
createInstance
(
ContextAwareMenuItemActionItem
,
action
)
:
undefined
;
const
menus
=
this
.
instantiationService
.
createInstance
(
TreeMenus
,
this
.
id
);
const
dataSource
=
this
.
instantiationService
.
createInstance
(
TreeDataSource
,
this
,
this
.
progressLocation
);
const
dataSource
=
this
.
instantiationService
.
createInstance
(
TreeDataSource
,
this
,
this
.
container
);
const
renderer
=
this
.
instantiationService
.
createInstance
(
TreeRenderer
,
this
.
id
,
menus
,
actionItemProvider
);
const
controller
=
this
.
instantiationService
.
createInstance
(
TreeController
,
this
.
id
,
menus
);
this
.
tree
=
this
.
instantiationService
.
createInstance
(
FileIconThemableWorkbenchTree
,
this
.
treeContainer
,
{
dataSource
,
renderer
,
controller
},
{});
...
...
@@ -395,7 +395,7 @@ class TreeDataSource implements IDataSource {
constructor
(
private
treeView
:
ITreeViewer
,
private
location
:
ProgressLocation
,
private
container
:
ViewContainer
,
@
IProgressService2
private
progressService
:
IProgressService2
)
{
}
...
...
@@ -410,7 +410,7 @@ class TreeDataSource implements IDataSource {
public
getChildren
(
tree
:
ITree
,
node
:
ITreeItem
):
TPromise
<
any
[]
>
{
if
(
this
.
treeView
.
dataProvider
)
{
return
this
.
location
?
this
.
progressService
.
withProgress
({
location
:
this
.
location
},
()
=>
this
.
treeView
.
dataProvider
.
getChildren
(
node
))
:
this
.
treeView
.
dataProvider
.
getChildren
(
node
);
return
this
.
progressService
.
withProgress
({
location
:
this
.
container
},
()
=>
this
.
treeView
.
dataProvider
.
getChildren
(
node
)
);
}
return
TPromise
.
as
([]);
}
...
...
src/vs/workbench/common/views.ts
浏览文件 @
747c1018
...
...
@@ -243,7 +243,7 @@ export interface ITreeViewer extends IDisposable {
export
interface
ICustomViewDescriptor
extends
IViewDescriptor
{
treeViewer
:
ITreeViewer
;
readonly
treeViewer
:
ITreeViewer
;
}
...
...
src/vs/workbench/services/progress/browser/progressService2.ts
浏览文件 @
747c1018
...
...
@@ -20,6 +20,7 @@ import { ProgressBadge, IActivityService } from 'vs/workbench/services/activity/
import
{
INotificationService
,
Severity
,
INotificationHandle
,
INotificationActions
}
from
'
vs/platform/notification/common/notification
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
once
}
from
'
vs/base/common/event
'
;
import
{
ViewContainer
}
from
'
vs/workbench/common/views
'
;
class
WindowProgressItem
implements
IStatusbarItem
{
...
...
@@ -91,6 +92,15 @@ export class ProgressService2 implements IProgressService2 {
withProgress
<
P
extends
Thenable
<
R
>
,
R
=
any
>
(
options
:
IProgressOptions
,
task
:
(
progress
:
IProgress
<
IProgressStep
>
)
=>
P
,
onDidCancel
?:
()
=>
void
):
P
{
const
{
location
}
=
options
;
if
(
location
instanceof
ViewContainer
)
{
const
viewlet
=
this
.
_viewletService
.
getViewlet
(
location
.
id
);
if
(
viewlet
)
{
return
this
.
_withViewletProgress
(
location
.
id
,
task
);
}
console
.
warn
(
`Bad progress location:
${
location
.
id
}
`
);
return
undefined
;
}
switch
(
location
)
{
case
ProgressLocation
.
Notification
:
return
this
.
_withNotificationProgress
(
options
,
task
,
onDidCancel
);
...
...
src/vs/workbench/services/progress/common/progress.ts
浏览文件 @
747c1018
...
...
@@ -6,6 +6,7 @@
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IProgress
}
from
'
vs/platform/progress/common/progress
'
;
import
{
ViewContainer
}
from
'
vs/workbench/common/views
'
;
export
enum
ProgressLocation
{
Explorer
=
1
,
...
...
@@ -16,7 +17,7 @@ export enum ProgressLocation {
}
export
interface
IProgressOptions
{
location
:
ProgressLocation
;
location
:
ProgressLocation
|
ViewContainer
;
title
?:
string
;
source
?:
string
;
total
?:
number
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录