Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
950574c3
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,发现更多精彩内容 >>
提交
950574c3
编写于
2月 14, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #32012
上级
7fb62434
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
15 addition
and
4 deletion
+15
-4
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+5
-0
src/vs/workbench/api/node/extHostTreeViews.ts
src/vs/workbench/api/node/extHostTreeViews.ts
+1
-0
src/vs/workbench/api/node/extHostTypes.ts
src/vs/workbench/api/node/extHostTypes.ts
+1
-0
src/vs/workbench/browser/parts/views/customView.ts
src/vs/workbench/browser/parts/views/customView.ts
+4
-3
src/vs/workbench/common/views.ts
src/vs/workbench/common/views.ts
+4
-1
未找到文件。
src/vs/vscode.d.ts
浏览文件 @
950574c3
...
...
@@ -5089,6 +5089,11 @@ declare module 'vscode' {
*/
resourceUri
?:
Uri
;
/**
* The tooltip text when you hover over this item.
*/
tooltip
?:
string
|
undefined
;
/**
* The [command](#Command) which should be run when the tree item is selected.
*/
...
...
src/vs/workbench/api/node/extHostTreeViews.ts
浏览文件 @
950574c3
...
...
@@ -185,6 +185,7 @@ class ExtHostTreeView<T> extends Disposable {
parentHandle
,
label
:
extensionTreeItem
.
label
,
resourceUri
:
extensionTreeItem
.
resourceUri
,
tooltip
:
typeof
extensionTreeItem
.
tooltip
===
'
string
'
?
extensionTreeItem
.
tooltip
:
void
0
,
command
:
extensionTreeItem
.
command
?
this
.
commands
.
toInternal
(
extensionTreeItem
.
command
)
:
void
0
,
contextValue
:
extensionTreeItem
.
contextValue
,
icon
,
...
...
src/vs/workbench/api/node/extHostTypes.ts
浏览文件 @
950574c3
...
...
@@ -1524,6 +1524,7 @@ export class TreeItem {
iconPath
?:
string
|
URI
|
{
light
:
string
|
URI
;
dark
:
string
|
URI
};
command
?:
vscode
.
Command
;
contextValue
?:
string
;
tooltip
?:
string
;
constructor
(
label
:
string
,
collapsibleState
?:
vscode
.
TreeItemCollapsibleState
)
constructor
(
resourceUri
:
URI
,
collapsibleState
?:
vscode
.
TreeItemCollapsibleState
)
...
...
src/vs/workbench/browser/parts/views/customView.ts
浏览文件 @
950574c3
...
...
@@ -404,7 +404,7 @@ class TreeRenderer implements IRenderer {
public
renderElement
(
tree
:
ITree
,
node
:
ITreeItem
,
templateId
:
string
,
templateData
:
ITreeExplorerTemplateData
):
void
{
const
resource
=
node
.
resourceUri
?
URI
.
revive
(
node
.
resourceUri
)
:
null
;
const
name
=
node
.
label
?
node
.
label
:
resource
?
basename
(
resource
.
path
)
:
''
;
const
label
=
node
.
label
?
node
.
label
:
resource
?
basename
(
resource
.
path
)
:
''
;
const
icon
=
this
.
themeService
.
getTheme
().
type
===
LIGHT
?
node
.
icon
:
node
.
iconDark
;
// reset
...
...
@@ -415,11 +415,12 @@ class TreeRenderer implements IRenderer {
DOM
.
removeClass
(
templateData
.
resourceLabel
.
element
,
'
custom-view-tree-node-item-resourceLabel
'
);
if
(
resource
&&
!
icon
)
{
templateData
.
resourceLabel
.
setLabel
({
name
,
resource
},
{
fileKind
:
node
.
collapsibleState
===
TreeItemCollapsibleState
.
Collapsed
||
node
.
collapsibleState
===
TreeItemCollapsibleState
.
Expanded
?
FileKind
.
FOLDER
:
FileKind
.
FILE
});
templateData
.
resourceLabel
.
setLabel
({
name
:
label
,
resource
},
{
fileKind
:
node
.
collapsibleState
===
TreeItemCollapsibleState
.
Collapsed
||
node
.
collapsibleState
===
TreeItemCollapsibleState
.
Expanded
?
FileKind
.
FOLDER
:
FileKind
.
FILE
,
title
:
node
.
tooltip
});
DOM
.
addClass
(
templateData
.
resourceLabel
.
element
,
'
custom-view-tree-node-item-resourceLabel
'
);
}
else
{
templateData
.
label
.
textContent
=
name
;
templateData
.
label
.
textContent
=
label
;
DOM
.
addClass
(
templateData
.
label
,
'
custom-view-tree-node-item-label
'
);
templateData
.
label
.
title
=
typeof
node
.
tooltip
===
'
string
'
?
node
.
tooltip
:
label
;
}
templateData
.
icon
.
treeItem
=
node
;
...
...
src/vs/workbench/common/views.ts
浏览文件 @
950574c3
...
...
@@ -204,6 +204,8 @@ export interface ITreeItem {
parentHandle
:
string
;
collapsibleState
:
TreeItemCollapsibleState
;
label
?:
string
;
icon
?:
string
;
...
...
@@ -212,13 +214,14 @@ export interface ITreeItem {
resourceUri
?:
UriComponents
;
tooltip
?:
string
;
contextValue
?:
string
;
command
?:
Command
;
children
?:
ITreeItem
[];
collapsibleState
:
TreeItemCollapsibleState
;
}
export
interface
ITreeViewDataProvider
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录