Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ea787762
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,发现更多精彩内容 >>
提交
ea787762
编写于
2月 09, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#28974 Introduce place holder icons for nodes without icons
上级
125ac04d
变更
17
展开全部
隐藏空白更改
内联
并排
Showing
17 changed file
with
494 addition
and
376 deletion
+494
-376
src/vs/platform/progress/common/progress.ts
src/vs/platform/progress/common/progress.ts
+3
-2
src/vs/workbench/api/browser/viewsExtensionPoint.ts
src/vs/workbench/api/browser/viewsExtensionPoint.ts
+2
-2
src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts
src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts
+22
-29
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-2
src/vs/workbench/api/node/extHostTreeViews.ts
src/vs/workbench/api/node/extHostTreeViews.ts
+0
-8
src/vs/workbench/browser/parts/views/customView.ts
src/vs/workbench/browser/parts/views/customView.ts
+236
-316
src/vs/workbench/browser/parts/views/customViewPanel.ts
src/vs/workbench/browser/parts/views/customViewPanel.ts
+144
-0
src/vs/workbench/browser/parts/views/media/Document_16x.svg
src/vs/workbench/browser/parts/views/media/Document_16x.svg
+1
-0
src/vs/workbench/browser/parts/views/media/Document_16x_inverse.svg
...kbench/browser/parts/views/media/Document_16x_inverse.svg
+1
-0
src/vs/workbench/browser/parts/views/media/FolderOpen_16x.svg
...vs/workbench/browser/parts/views/media/FolderOpen_16x.svg
+1
-0
src/vs/workbench/browser/parts/views/media/FolderOpen_16x_inverse.svg
...ench/browser/parts/views/media/FolderOpen_16x_inverse.svg
+1
-0
src/vs/workbench/browser/parts/views/media/Folder_16x.svg
src/vs/workbench/browser/parts/views/media/Folder_16x.svg
+1
-0
src/vs/workbench/browser/parts/views/media/Folder_16x_inverse.svg
...orkbench/browser/parts/views/media/Folder_16x_inverse.svg
+1
-0
src/vs/workbench/browser/parts/views/media/views.css
src/vs/workbench/browser/parts/views/media/views.css
+48
-3
src/vs/workbench/common/views.ts
src/vs/workbench/common/views.ts
+24
-8
src/vs/workbench/services/progress/browser/progressService2.ts
...s/workbench/services/progress/browser/progressService2.ts
+2
-0
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
...kbench/test/electron-browser/api/extHostTreeViews.test.ts
+6
-6
未找到文件。
src/vs/platform/progress/common/progress.ts
浏览文件 @
ea787762
...
...
@@ -63,8 +63,9 @@ export class Progress<T> implements IProgress<T> {
}
export
enum
ProgressLocation
{
Scm
=
1
,
Extensions
=
2
,
Explorer
=
1
,
Scm
=
3
,
Extensions
=
5
,
Window
=
10
}
...
...
src/vs/workbench/api/browser/viewsExtensionPoint.ts
浏览文件 @
ea787762
...
...
@@ -9,7 +9,7 @@ import { forEach } from 'vs/base/common/collections';
import
{
IJSONSchema
}
from
'
vs/base/common/jsonSchema
'
;
import
{
ExtensionMessageCollector
,
ExtensionsRegistry
}
from
'
vs/platform/extensions/common/extensionsRegistry
'
;
import
{
ViewLocation
,
ViewsRegistry
,
ICustomViewDescriptor
}
from
'
vs/workbench/common/views
'
;
import
{
CustomTreeViewPanel
}
from
'
vs/workbench/browser/parts/views/customView
'
;
import
{
CustomTreeViewPanel
}
from
'
vs/workbench/browser/parts/views/customView
Panel
'
;
import
{
ContextKeyExpr
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
coalesce
,
}
from
'
vs/base/common/arrays
'
;
...
...
@@ -110,7 +110,7 @@ ExtensionsRegistry.registerExtensionPoint<{ [loc: string]: schema.IUserFriendlyV
when
:
ContextKeyExpr
.
deserialize
(
item
.
when
),
canToggleVisibility
:
true
,
collapsed
:
true
,
tree
Item
View
:
true
treeView
:
true
};
// validate
...
...
src/vs/workbench/api/electron-browser/mainThreadTreeViews.ts
浏览文件 @
ea787762
...
...
@@ -11,12 +11,13 @@ import { ExtHostContext, MainThreadTreeViewsShape, ExtHostTreeViewsShape, MainCo
import
{
IMessageService
,
Severity
}
from
'
vs/platform/message/common/message
'
;
import
{
ITreeViewDataProvider
,
ITreeItem
,
ICustomViewsService
}
from
'
vs/workbench/common/views
'
;
import
{
extHostNamedCustomer
}
from
'
vs/workbench/api/electron-browser/extHostCustomers
'
;
import
{
assign
}
from
'
vs/base/common/object
s
'
;
import
{
distinct
}
from
'
vs/base/common/array
s
'
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadTreeViews
)
export
class
MainThreadTreeViews
extends
Disposable
implements
MainThreadTreeViewsShape
{
private
_proxy
:
ExtHostTreeViewsShape
;
private
_dataProviders
:
Map
<
string
,
TreeViewDataProvider
>
=
new
Map
<
string
,
TreeViewDataProvider
>
();
constructor
(
extHostContext
:
IExtHostContext
,
...
...
@@ -29,15 +30,21 @@ export class MainThreadTreeViews extends Disposable implements MainThreadTreeVie
$registerTreeViewDataProvider
(
treeViewId
:
string
):
void
{
const
dataProvider
=
this
.
_register
(
new
TreeViewDataProvider
(
treeViewId
,
this
.
_proxy
,
this
.
messageService
));
this
.
_dataProviders
.
set
(
treeViewId
,
dataProvider
);
this
.
viewsService
.
registerTreeViewDataProvider
(
treeViewId
,
dataProvider
);
}
$refresh
(
treeViewId
:
string
,
itemsToRefresh
:
{
[
treeItemHandle
:
string
]:
ITreeItem
}):
void
{
const
treeViewer
=
this
.
viewsService
.
getTreeItemViewer
(
treeViewId
);
if
(
treeViewer
&&
treeViewer
.
dataProvider
)
{
(
<
TreeViewDataProvider
>
treeViewer
.
dataProvider
)
.
refresh
(
itemsToRefresh
);
const
dataProvider
=
this
.
_dataProviders
.
get
(
treeViewId
);
if
(
dataProvider
)
{
dataProvider
.
refresh
(
itemsToRefresh
);
}
}
dispose
():
void
{
this
.
_dataProviders
.
clear
();
super
.
dispose
();
}
}
type
TreeItemHandle
=
string
;
...
...
@@ -58,23 +65,13 @@ class TreeViewDataProvider implements ITreeViewDataProvider {
)
{
}
getElements
():
TPromise
<
ITreeItem
[]
>
{
return
this
.
_proxy
.
$getElements
(
this
.
treeViewId
)
.
then
(
elements
=>
{
return
this
.
postGetElements
(
elements
);
},
err
=>
{
this
.
messageService
.
show
(
Severity
.
Error
,
err
);
return
[];
});
}
getChildren
(
treeItem
:
ITreeItem
):
TPromise
<
ITreeItem
[]
>
{
if
(
treeItem
.
children
)
{
getChildren
(
treeItem
?:
ITreeItem
):
TPromise
<
ITreeItem
[]
>
{
if
(
treeItem
&&
treeItem
.
children
)
{
return
TPromise
.
as
(
treeItem
.
children
);
}
return
this
.
_proxy
.
$getChildren
(
this
.
treeViewId
,
treeItem
.
handle
)
return
this
.
_proxy
.
$getChildren
(
this
.
treeViewId
,
treeItem
?
treeItem
.
handle
:
void
0
)
.
then
(
children
=>
{
return
this
.
postGet
Elements
(
children
);
return
this
.
postGet
Children
(
children
);
},
err
=>
{
this
.
messageService
.
show
(
Severity
.
Error
,
err
);
return
[];
...
...
@@ -108,19 +105,12 @@ class TreeViewDataProvider implements ITreeViewDataProvider {
}
}
private
postGet
Elements
(
elements
:
ITreeItem
[]):
ITreeItem
[]
{
private
postGet
Children
(
elements
:
ITreeItem
[]):
ITreeItem
[]
{
const
result
=
[];
if
(
elements
)
{
for
(
const
element
of
elements
)
{
const
currentTreeItem
=
this
.
itemsMap
.
get
(
element
.
handle
);
if
(
currentTreeItem
)
{
// Update the current item with new item
this
.
updateTreeItem
(
currentTreeItem
,
element
);
}
else
{
this
.
itemsMap
.
set
(
element
.
handle
,
element
);
}
// Always use the existing items
result
.
push
(
this
.
itemsMap
.
get
(
element
.
handle
));
this
.
itemsMap
.
set
(
element
.
handle
,
element
);
result
.
push
(
element
);
}
}
return
result
;
...
...
@@ -129,7 +119,10 @@ class TreeViewDataProvider implements ITreeViewDataProvider {
private
updateTreeItem
(
current
:
ITreeItem
,
treeItem
:
ITreeItem
):
void
{
treeItem
.
children
=
treeItem
.
children
?
treeItem
.
children
:
null
;
if
(
current
)
{
assign
(
current
,
treeItem
);
const
properties
=
distinct
([...
Object
.
keys
(
current
),
...
Object
.
keys
(
treeItem
)]);
for
(
const
property
of
properties
)
{
current
[
property
]
=
treeItem
[
property
];
}
}
}
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
ea787762
...
...
@@ -518,8 +518,7 @@ export interface ExtHostDocumentsAndEditorsShape {
}
export
interface
ExtHostTreeViewsShape
{
$getElements
(
treeViewId
:
string
):
TPromise
<
ITreeItem
[]
>
;
$getChildren
(
treeViewId
:
string
,
treeItemHandle
:
string
):
TPromise
<
ITreeItem
[]
>
;
$getChildren
(
treeViewId
:
string
,
treeItemHandle
?:
string
):
TPromise
<
ITreeItem
[]
>
;
}
export
interface
ExtHostWorkspaceShape
{
...
...
src/vs/workbench/api/node/extHostTreeViews.ts
浏览文件 @
ea787762
...
...
@@ -48,14 +48,6 @@ export class ExtHostTreeViews implements ExtHostTreeViewsShape {
};
}
$getElements
(
treeViewId
:
string
):
TPromise
<
ITreeItem
[]
>
{
const
treeView
=
this
.
treeViews
.
get
(
treeViewId
);
if
(
!
treeView
)
{
return
TPromise
.
wrapError
<
ITreeItem
[]
>
(
new
Error
(
localize
(
'
treeView.notRegistered
'
,
'
No tree view with id
\'
{0}
\'
registered.
'
,
treeViewId
)));
}
return
treeView
.
getChildren
();
}
$getChildren
(
treeViewId
:
string
,
treeItemHandle
?:
string
):
TPromise
<
ITreeItem
[]
>
{
const
treeView
=
this
.
treeViews
.
get
(
treeViewId
);
if
(
!
treeView
)
{
...
...
src/vs/workbench/browser/parts/views/customView.ts
浏览文件 @
ea787762
此差异已折叠。
点击以展开。
src/vs/workbench/browser/parts/views/customViewPanel.ts
0 → 100644
浏览文件 @
ea787762
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
'
vs/css!./media/views
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IDisposable
,
dispose
,
empty
as
EmptyDisposable
,
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IAction
,
IActionItem
}
from
'
vs/base/common/actions
'
;
import
{
IMessageService
}
from
'
vs/platform/message/common/message
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IMenuService
,
MenuId
,
MenuItemAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
fillInActions
,
ContextAwareMenuItemActionItem
}
from
'
vs/platform/actions/browser/menuItemActionItem
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
ICustomViewsService
,
ITreeViewer
}
from
'
vs/workbench/common/views
'
;
import
{
IViewletViewOptions
,
IViewOptions
,
ViewsViewletPanel
}
from
'
vs/workbench/browser/parts/views/viewsViewlet
'
;
export
class
CustomTreeViewPanel
extends
ViewsViewletPanel
{
private
menus
:
Menus
;
private
treeViewer
:
ITreeViewer
;
constructor
(
options
:
IViewletViewOptions
,
@
IMessageService
private
messageService
:
IMessageService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
,
@
IContextMenuService
contextMenuService
:
IContextMenuService
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
ICustomViewsService
customViewsService
:
ICustomViewsService
,
)
{
super
({
...(
options
as
IViewOptions
),
ariaHeaderLabel
:
options
.
name
},
keybindingService
,
contextMenuService
);
this
.
treeViewer
=
customViewsService
.
getTreeViewer
(
this
.
id
);
this
.
menus
=
this
.
instantiationService
.
createInstance
(
Menus
,
this
.
id
);
this
.
menus
.
onDidChangeTitle
(()
=>
this
.
updateActions
(),
this
,
this
.
disposables
);
this
.
updateTreeVisibility
();
}
setVisible
(
visible
:
boolean
):
TPromise
<
void
>
{
return
super
.
setVisible
(
visible
).
then
(()
=>
this
.
updateTreeVisibility
());
}
focus
():
void
{
super
.
focus
();
this
.
treeViewer
.
focus
();
}
renderBody
(
container
:
HTMLElement
):
void
{
this
.
treeViewer
.
render
(
container
);
}
setExpanded
(
expanded
:
boolean
):
void
{
this
.
treeViewer
.
setVisibility
(
this
.
isVisible
()
&&
expanded
);
super
.
setExpanded
(
expanded
);
}
layoutBody
(
size
:
number
):
void
{
this
.
treeViewer
.
layout
(
size
);
}
getActions
():
IAction
[]
{
return
[...
this
.
menus
.
getTitleActions
()];
}
getSecondaryActions
():
IAction
[]
{
return
this
.
menus
.
getTitleSecondaryActions
();
}
getActionItem
(
action
:
IAction
):
IActionItem
{
return
action
instanceof
MenuItemAction
?
new
ContextAwareMenuItemActionItem
(
action
,
this
.
keybindingService
,
this
.
messageService
,
this
.
contextMenuService
)
:
undefined
;
}
getOptimalWidth
():
number
{
return
this
.
treeViewer
.
getOptimalWidth
();
}
private
updateTreeVisibility
():
void
{
this
.
treeViewer
.
setVisibility
(
this
.
isVisible
()
&&
this
.
isExpanded
());
}
dispose
():
void
{
dispose
(
this
.
disposables
);
super
.
dispose
();
}
}
export
class
Menus
implements
IDisposable
{
private
disposables
:
IDisposable
[]
=
[];
private
titleDisposable
:
IDisposable
=
EmptyDisposable
;
private
titleActions
:
IAction
[]
=
[];
private
titleSecondaryActions
:
IAction
[]
=
[];
private
_onDidChangeTitle
=
new
Emitter
<
void
>
();
get
onDidChangeTitle
():
Event
<
void
>
{
return
this
.
_onDidChangeTitle
.
event
;
}
constructor
(
id
:
string
,
@
IContextKeyService
private
contextKeyService
:
IContextKeyService
,
@
IMenuService
private
menuService
:
IMenuService
,
@
IContextMenuService
private
contextMenuService
:
IContextMenuService
)
{
if
(
this
.
titleDisposable
)
{
this
.
titleDisposable
.
dispose
();
this
.
titleDisposable
=
EmptyDisposable
;
}
const
_contextKeyService
=
this
.
contextKeyService
.
createScoped
();
_contextKeyService
.
createKey
(
'
view
'
,
id
);
const
titleMenu
=
this
.
menuService
.
createMenu
(
MenuId
.
ViewTitle
,
_contextKeyService
);
const
updateActions
=
()
=>
{
this
.
titleActions
=
[];
this
.
titleSecondaryActions
=
[];
fillInActions
(
titleMenu
,
null
,
{
primary
:
this
.
titleActions
,
secondary
:
this
.
titleSecondaryActions
},
this
.
contextMenuService
);
this
.
_onDidChangeTitle
.
fire
();
};
const
listener
=
titleMenu
.
onDidChange
(
updateActions
);
updateActions
();
this
.
titleDisposable
=
toDisposable
(()
=>
{
listener
.
dispose
();
titleMenu
.
dispose
();
_contextKeyService
.
dispose
();
this
.
titleActions
=
[];
this
.
titleSecondaryActions
=
[];
});
}
getTitleActions
():
IAction
[]
{
return
this
.
titleActions
;
}
getTitleSecondaryActions
():
IAction
[]
{
return
this
.
titleSecondaryActions
;
}
dispose
():
void
{
this
.
disposables
=
dispose
(
this
.
disposables
);
}
}
\ No newline at end of file
src/vs/workbench/browser/parts/views/media/Document_16x.svg
0 → 100644
浏览文件 @
ea787762
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
><style
type=
"text/css"
>
.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{opacity:0;fill:#F6F6F6;} .icon-vs-bg{fill:#656565;} .icon-vs-fg{fill:#F0EFF1;}
</style><path
class=
"icon-canvas-transparent"
d=
"M16 16h-16v-16h16v16z"
id=
"canvas"
/><path
class=
"icon-vs-out"
d=
"M4 15c-.97 0-2-.701-2-2v-10c0-1.299 1.03-2 2-2h6.061l3.939 3.556v8.444c0 .97-.701 2-2 2h-8z"
id=
"outline"
/><path
class=
"icon-vs-bg"
d=
"M9.641,2H3.964C3.964,2,3,2,3,3c0,0.805,0,7.442,0,10c0,1,0.965,1,0.965,1s7,0,8,0S13,13,13,13V5L9.641,2zM12,13H4V3h5v3h3V13z"
id=
"iconBg"
/><path
class=
"icon-vs-fg"
d=
"M4 3h5v3h3v7h-8v-10z"
id=
"iconFg"
/></svg>
\ No newline at end of file
src/vs/workbench/browser/parts/views/media/Document_16x_inverse.svg
0 → 100755
浏览文件 @
ea787762
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
><style
type=
"text/css"
>
.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{opacity:0;fill:#F6F6F6;} .icon-vs-bg{fill:#C5C5C5;} .icon-vs-fg{opacity:0;fill:#F0EFF1;}
</style><path
class=
"icon-canvas-transparent"
d=
"M16 16h-16v-16h16v16z"
id=
"canvas"
/><path
class=
"icon-vs-out"
d=
"M4 15c-.97 0-2-.701-2-2v-10c0-1.299 1.03-2 2-2h6.061l3.939 3.556v8.444c0 .97-.701 2-2 2h-8z"
id=
"outline"
/><path
class=
"icon-vs-bg"
d=
"M9.641,2H3.964C3.964,2,3,2,3,3c0,0.805,0,7.442,0,10c0,1,0.965,1,0.965,1s7,0,8,0S13,13,13,13V5L9.641,2zM12,13H4V3h5v3h3V13z"
id=
"iconBg"
/><path
class=
"icon-vs-fg"
d=
"M4 3h5v3h3v7h-8v-10z"
id=
"iconFg"
/></svg>
\ No newline at end of file
src/vs/workbench/browser/parts/views/media/FolderOpen_16x.svg
0 → 100644
浏览文件 @
ea787762
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
><style
type=
"text/css"
>
.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{opacity:0;fill:#F6F6F6;} .icon-vs-fg{fill:#F0EFF1;} .icon-folder{fill:#656565;}
</style><path
class=
"icon-canvas-transparent"
d=
"M16 16h-16v-16h16v16z"
id=
"canvas"
/><path
class=
"icon-vs-out"
d=
"M14 .969h-7.116l-1 2h-2.884c-.97 0-2 .701-2 2v2h-1v1.196l2.323 5.804h11.677s.86-.021 1.43-.565c.344-.332.57-.817.57-1.435v-9c0-1.303-1.005-2-2-2z"
id=
"outline"
/><path
class=
"icon-folder"
d=
"M14,2c0,0,1,0,1,1c0,2.36,0,8.205,0,9c0,1-1,0.984-1,0.984V3H8L7,5H3v3h8l3,5H3L1,8h1c0,0,0-2,0-3s1.236-1,1-1h3.5l1-2H14z"
id=
"iconBg"
/><path
class=
"icon-vs-fg"
d=
"M3 7.969v-3h4l1-2h6v10l-3-5h-8z"
id=
"iconFg"
/></svg>
\ No newline at end of file
src/vs/workbench/browser/parts/views/media/FolderOpen_16x_inverse.svg
0 → 100755
浏览文件 @
ea787762
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
><style
type=
"text/css"
>
.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{opacity:0;fill:#F6F6F6;} .icon-vs-fg{opacity:0;fill:#F0EFF1;} .icon-folder{fill:#C5C5C5;}
</style><path
class=
"icon-canvas-transparent"
d=
"M16 16h-16v-16h16v16z"
id=
"canvas"
/><path
class=
"icon-vs-out"
d=
"M14 .969h-7.116l-1 2h-2.884c-.97 0-2 .701-2 2v2h-1v1.196l2.323 5.804h11.677s.86-.021 1.43-.565c.344-.332.57-.817.57-1.435v-9c0-1.303-1.005-2-2-2z"
id=
"outline"
/><path
class=
"icon-folder"
d=
"M14,2c0,0,1,0,1,1c0,2.36,0,8.205,0,9c0,1-1,0.984-1,0.984V3H8L7,5H3v3h8l3,5H3L1,8h1c0,0,0-2,0-3s1.236-1,1-1h3.5l1-2H14z"
id=
"iconBg"
/><path
class=
"icon-vs-fg"
d=
"M3 7.969v-3h4l1-2h6v10l-3-5h-8z"
id=
"iconFg"
/></svg>
\ No newline at end of file
src/vs/workbench/browser/parts/views/media/Folder_16x.svg
0 → 100644
浏览文件 @
ea787762
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
><style
type=
"text/css"
>
.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{opacity:0;fill:#F6F6F6;} .icon-vs-fg{fill:#F0EFF1;} .icon-folder{fill:#656565;}
</style><path
class=
"icon-canvas-transparent"
d=
"M16 16h-16v-16h16v16z"
id=
"canvas"
/><path
class=
"icon-vs-out"
d=
"M16 2.5v10c0 .827-.673 1.5-1.5 1.5h-11.996c-.827 0-1.5-.673-1.5-1.5v-8c0-.827.673-1.5 1.5-1.5h2.886l1-2h8.11c.827 0 1.5.673 1.5 1.5z"
id=
"outline"
/><path
class=
"icon-folder"
d=
"M14.5 2h-7.492l-1 2h-3.504c-.277 0-.5.224-.5.5v8c0 .276.223.5.5.5h11.996c.275 0 .5-.224.5-.5v-10c0-.276-.225-.5-.5-.5zm-.496 2h-6.496l.5-1h5.996v1z"
id=
"iconBg"
/><path
class=
"icon-vs-fg"
d=
"M14 3v1h-6.5l.5-1h6z"
id=
"iconFg"
/></svg>
\ No newline at end of file
src/vs/workbench/browser/parts/views/media/Folder_16x_inverse.svg
0 → 100755
浏览文件 @
ea787762
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"16"
height=
"16"
><style
type=
"text/css"
>
.icon-canvas-transparent{opacity:0;fill:#F6F6F6;} .icon-vs-out{opacity:0;fill:#F6F6F6;} .icon-vs-fg{opacity:0;fill:#F0EFF1;} .icon-folder{fill:#C5C5C5;}
</style><path
class=
"icon-canvas-transparent"
d=
"M16 16h-16v-16h16v16z"
id=
"canvas"
/><path
class=
"icon-vs-out"
d=
"M16 2.5v10c0 .827-.673 1.5-1.5 1.5h-11.996c-.827 0-1.5-.673-1.5-1.5v-8c0-.827.673-1.5 1.5-1.5h2.886l1-2h8.11c.827 0 1.5.673 1.5 1.5z"
id=
"outline"
/><path
class=
"icon-folder"
d=
"M14.5 2h-7.492l-1 2h-3.504c-.277 0-.5.224-.5.5v8c0 .276.223.5.5.5h11.996c.275 0 .5-.224.5-.5v-10c0-.276-.225-.5-.5-.5zm-.496 2h-6.496l.5-1h5.996v1z"
id=
"iconBg"
/><path
class=
"icon-vs-fg"
d=
"M14 3v1h-6.5l.5-1h6z"
id=
"iconFg"
/></svg>
\ No newline at end of file
src/vs/workbench/browser/parts/views/media/views.css
浏览文件 @
ea787762
...
...
@@ -50,9 +50,12 @@
display
:
none
;
}
.tree-explorer-viewlet-tree-view.file-icon-themable-tree.align-icons-and-twisties
.monaco-tree-row
:not
(
.has-children
)
.content
:not
(
.align-with-twisty
)
::before
,
.tree-explorer-viewlet-tree-view.file-icon-themable-tree.hide-arrows
.monaco-tree-row
.content
::before
{
display
:
inline-block
;
.tree-explorer-viewlet-tree-view.file-icon-themable-tree.custom-view-align-icons-and-twisties
.monaco-tree-row
:not
(
.has-children
)
.content
::before
{
display
:
none
;
}
.tree-explorer-viewlet-tree-view.file-icon-themable-tree.align-icons-and-twisties
:not
(
.custom-view-align-icons-and-twisties
)
.monaco-tree-row
:not
(
.has-children
)
.content
::before
{
display
:
block
;
}
.tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
{
...
...
@@ -82,6 +85,48 @@
-webkit-font-smoothing
:
antialiased
;
}
.tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-icon.placeholder-icon
{
border
:
1px
;
border-style
:
dashed
;
border-radius
:
1px
;
margin
:
5px
6px
5px
2px
;
height
:
12px
;
width
:
6px
;
}
.tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-icon.file-icon
{
content
:
' '
;
background-image
:
url('Document_16x.svg')
;
}
.hs-black
.tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-icon.file-icon
,
.vs-dark
.tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-icon.file-icon
{
content
:
' '
;
background-image
:
url('Document_16x_inverse.svg')
;
}
.tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-icon.folder-icon
{
content
:
' '
;
background-image
:
url('Folder_16x.svg')
;
}
.hs-black
.tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-icon.folder-icon
,
.vs-dark
.tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.custom-view-tree-node-item-icon.folder-icon
{
content
:
' '
;
background-image
:
url('Folder_16x_inverse.svg')
;
}
.tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row.expanded
.custom-view-tree-node-item
>
.custom-view-tree-node-item-icon.folder-icon
{
content
:
' '
;
background-image
:
url('FolderOpen_16x.svg')
;
}
.hc-black
.tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row.expanded
.custom-view-tree-node-item
>
.custom-view-tree-node-item-icon.folder-icon
,
.vs-dark
.tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row.expanded
.custom-view-tree-node-item
>
.custom-view-tree-node-item-icon.folder-icon
{
content
:
' '
;
background-image
:
url('FolderOpen_16x_inverse.svg')
;
}
.tree-explorer-viewlet-tree-view
.monaco-tree
.monaco-tree-row
.custom-view-tree-node-item
>
.actions
{
display
:
none
;
padding-right
:
6px
;
...
...
src/vs/workbench/common/views.ts
浏览文件 @
ea787762
...
...
@@ -12,6 +12,7 @@ import { ITreeViewDataProvider } from 'vs/workbench/common/views';
import
{
localize
}
from
'
vs/nls
'
;
import
{
IViewlet
}
from
'
vs/workbench/common/viewlet
'
;
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
export
class
ViewLocation
{
...
...
@@ -69,6 +70,8 @@ export interface IViewsRegistry {
getViews
(
loc
:
ViewLocation
):
IViewDescriptor
[];
getAllViews
():
IViewDescriptor
[];
getView
(
id
:
string
):
IViewDescriptor
;
}
...
...
@@ -128,6 +131,12 @@ export const ViewsRegistry: IViewsRegistry = new class implements IViewsRegistry
return
this
.
_views
.
get
(
loc
)
||
[];
}
getAllViews
():
IViewDescriptor
[]
{
const
result
:
IViewDescriptor
[]
=
[];
this
.
_views
.
forEach
(
views
=>
result
.
push
(...
views
));
return
result
;
}
getView
(
id
:
string
):
IViewDescriptor
{
for
(
const
viewLocation
of
this
.
_viewLocations
)
{
const
viewDescriptor
=
(
this
.
_views
.
get
(
viewLocation
)
||
[]).
filter
(
v
=>
v
.
id
===
id
)[
0
];
...
...
@@ -147,17 +156,26 @@ export interface IViewsViewlet extends IViewlet {
// Custom views
export
interface
ITreeItemViewer
{
export
interface
ITreeViewer
extends
IDisposable
{
readonly
dataProvider
:
ITreeViewDataProvider
;
dataProvider
:
ITreeViewDataProvider
;
refresh
(
treeItems
?:
ITreeItem
[]):
TPromise
<
void
>
;
refresh
(
treeItems
:
ITreeItem
[]):
TPromise
<
void
>
;
setVisibility
(
visible
:
boolean
):
void
;
focus
():
void
;
layout
(
height
:
number
):
void
;
render
(
container
:
HTMLElement
);
getOptimalWidth
():
number
;
}
export
interface
ICustomViewDescriptor
extends
IViewDescriptor
{
tree
Item
View
?:
boolean
;
treeView
?:
boolean
;
}
...
...
@@ -166,7 +184,7 @@ export const ICustomViewsService = createDecorator<ICustomViewsService>('customV
export
interface
ICustomViewsService
{
_serviceBrand
:
any
;
getTree
ItemViewer
(
id
:
string
):
ITreeItem
Viewer
;
getTree
Viewer
(
id
:
string
):
ITree
Viewer
;
registerTreeViewDataProvider
(
id
:
string
,
ITreeViewDataProvider
):
void
;
}
...
...
@@ -211,7 +229,5 @@ export interface ITreeViewDataProvider {
onDispose
:
Event
<
void
>
;
getElements
():
TPromise
<
ITreeItem
[]
>
;
getChildren
(
element
:
ITreeItem
):
TPromise
<
ITreeItem
[]
>
;
getChildren
(
element
?:
ITreeItem
):
TPromise
<
ITreeItem
[]
>
;
}
\ No newline at end of file
src/vs/workbench/services/progress/browser/progressService2.ts
浏览文件 @
ea787762
...
...
@@ -73,6 +73,8 @@ export class ProgressService2 implements IProgressService2 {
switch
(
location
)
{
case
ProgressLocation
.
Window
:
return
this
.
_withWindowProgress
(
options
,
task
);
case
ProgressLocation
.
Explorer
:
return
this
.
_withViewletProgress
(
'
workbench.view.explorer
'
,
task
);
case
ProgressLocation
.
Scm
:
return
this
.
_withViewletProgress
(
'
workbench.view.scm
'
,
task
);
case
ProgressLocation
.
Extensions
:
...
...
src/vs/workbench/test/electron-browser/api/extHostTreeViews.test.ts
浏览文件 @
ea787762
...
...
@@ -72,7 +72,7 @@ suite('ExtHostTreeView', function () {
testObject
.
registerTreeDataProvider
(
'
testNodeTreeProvider
'
,
aNodeTreeDataProvider
());
testObject
.
registerTreeDataProvider
(
'
testNodeWithIdTreeProvider
'
,
aNodeWithIdTreeDataProvider
());
testObject
.
$get
Elements
(
'
testNodeTreeProvider
'
).
then
(
elements
=>
{
testObject
.
$get
Children
(
'
testNodeTreeProvider
'
).
then
(
elements
=>
{
for
(
const
element
of
elements
)
{
testObject
.
$getChildren
(
'
testNodeTreeProvider
'
,
element
.
handle
);
}
...
...
@@ -80,7 +80,7 @@ suite('ExtHostTreeView', function () {
});
test
(
'
construct node tree
'
,
()
=>
{
return
testObject
.
$get
Elements
(
'
testNodeTreeProvider
'
)
return
testObject
.
$get
Children
(
'
testNodeTreeProvider
'
)
.
then
(
elements
=>
{
const
actuals
=
elements
.
map
(
e
=>
e
.
handle
);
assert
.
deepEqual
(
actuals
,
[
'
0/0:a
'
,
'
0/0:b
'
]);
...
...
@@ -108,7 +108,7 @@ suite('ExtHostTreeView', function () {
});
test
(
'
construct id tree
'
,
()
=>
{
return
testObject
.
$get
Elements
(
'
testNodeWithIdTreeProvider
'
)
return
testObject
.
$get
Children
(
'
testNodeWithIdTreeProvider
'
)
.
then
(
elements
=>
{
const
actuals
=
elements
.
map
(
e
=>
e
.
handle
);
assert
.
deepEqual
(
actuals
,
[
'
1/a
'
,
'
1/b
'
]);
...
...
@@ -139,7 +139,7 @@ suite('ExtHostTreeView', function () {
tree
[
'
a
'
]
=
{
'
a
'
:
{}
};
return
testObject
.
$get
Elements
(
'
testNodeWithIdTreeProvider
'
)
return
testObject
.
$get
Children
(
'
testNodeWithIdTreeProvider
'
)
.
then
(
elements
=>
{
const
actuals
=
elements
.
map
(
e
=>
e
.
handle
);
assert
.
deepEqual
(
actuals
,
[
'
1/a
'
,
'
1/b
'
]);
...
...
@@ -300,7 +300,7 @@ suite('ExtHostTreeView', function () {
onDidChangeTreeNode
.
fire
();
return
testObject
.
$get
Elements
(
'
testNodeTreeProvider
'
)
return
testObject
.
$get
Children
(
'
testNodeTreeProvider
'
)
.
then
(
elements
=>
{
assert
.
deepEqual
(
elements
.
map
(
e
=>
e
.
handle
),
[
'
0/0:a//0:b
'
]);
});
...
...
@@ -338,7 +338,7 @@ suite('ExtHostTreeView', function () {
tree
[
'
f
'
]
=
{};
tree
[
dupItems
[
'
adup2
'
]]
=
{};
return
testObject
.
$get
Elements
(
'
testNodeTreeProvider
'
)
return
testObject
.
$get
Children
(
'
testNodeTreeProvider
'
)
.
then
(
elements
=>
{
const
actuals
=
elements
.
map
(
e
=>
e
.
handle
);
assert
.
deepEqual
(
actuals
,
[
'
0/0:a
'
,
'
0/0:b
'
,
'
0/1:a
'
,
'
0/0:d
'
,
'
0/1:b
'
,
'
0/0:f
'
,
'
0/2:a
'
]);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录