Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
bbde6d2b
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,发现更多精彩内容 >>
提交
bbde6d2b
编写于
7月 21, 2019
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
compressed trees: typing
上级
e0960021
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
19 deletion
+40
-19
src/vs/base/browser/ui/tree/compressedObjectTreeModel.ts
src/vs/base/browser/ui/tree/compressedObjectTreeModel.ts
+38
-17
src/vs/base/browser/ui/tree/objectTreeModel.ts
src/vs/base/browser/ui/tree/objectTreeModel.ts
+2
-2
未找到文件。
src/vs/base/browser/ui/tree/compressedObjectTreeModel.ts
浏览文件 @
bbde6d2b
...
...
@@ -82,18 +82,18 @@ export function splice<T>(treeElement: ICompressedTreeElement<T>, element: T, ch
export
interface
ICompressedObjectTreeModelOptions
<
T
,
TFilterData
>
extends
IObjectTreeModelOptions
<
ICompressedTreeNode
<
T
>
,
TFilterData
>
{
}
export
class
CompressedObjectTreeModel
<
T
extends
NonNullable
<
any
>
,
TFilterData
extends
NonNullable
<
any
>
=
void
>
implements
ITreeModel
<
T
|
null
,
TFilterData
,
T
|
null
>
{
export
class
CompressedObjectTreeModel
<
T
extends
NonNullable
<
any
>
,
TFilterData
extends
NonNullable
<
any
>
=
void
>
implements
ITreeModel
<
ICompressedTreeNode
<
T
>
|
null
,
TFilterData
,
T
|
null
>
{
readonly
rootRef
=
null
;
private
_onDidSplice
=
new
Emitter
<
ITreeModelSpliceEvent
<
T
|
null
,
TFilterData
>>
();
readonly
onDidSplice
:
Event
<
ITreeModelSpliceEvent
<
T
|
null
,
TFilterData
>>
=
this
.
_onDidSplice
.
event
;
private
_onDidSplice
=
new
Emitter
<
ITreeModelSpliceEvent
<
ICompressedTreeNode
<
T
>
|
null
,
TFilterData
>>
();
readonly
onDidSplice
:
Event
<
ITreeModelSpliceEvent
<
ICompressedTreeNode
<
T
>
|
null
,
TFilterData
>>
=
this
.
_onDidSplice
.
event
;
private
_onDidChangeCollapseState
=
new
Emitter
<
ICollapseStateChangeEvent
<
T
,
TFilterData
>>
();
readonly
onDidChangeCollapseState
:
Event
<
ICollapseStateChangeEvent
<
T
,
TFilterData
>>
=
this
.
_onDidChangeCollapseState
.
event
;
private
_onDidChangeCollapseState
=
new
Emitter
<
ICollapseStateChangeEvent
<
ICompressedTreeNode
<
T
>
,
TFilterData
>>
();
readonly
onDidChangeCollapseState
:
Event
<
ICollapseStateChangeEvent
<
ICompressedTreeNode
<
T
>
,
TFilterData
>>
=
this
.
_onDidChangeCollapseState
.
event
;
private
_onDidChangeRenderNodeCount
=
new
Emitter
<
ITreeNode
<
T
,
TFilterData
>>
();
readonly
onDidChangeRenderNodeCount
:
Event
<
ITreeNode
<
T
,
TFilterData
>>
=
this
.
_onDidChangeRenderNodeCount
.
event
;
private
_onDidChangeRenderNodeCount
=
new
Emitter
<
ITreeNode
<
ICompressedTreeNode
<
T
>
,
TFilterData
>>
();
readonly
onDidChangeRenderNodeCount
:
Event
<
ITreeNode
<
ICompressedTreeNode
<
T
>
,
TFilterData
>>
=
this
.
_onDidChangeRenderNodeCount
.
event
;
private
model
:
ObjectTreeModel
<
ICompressedTreeNode
<
T
>
,
TFilterData
>
;
private
nodes
=
new
Map
<
T
|
null
,
ICompressedTreeNode
<
T
>>
();
...
...
@@ -171,19 +171,26 @@ export class CompressedObjectTreeModel<T extends NonNullable<any>, TFilterData e
return
Iterator
.
empty
();
}
getListIndex
(
location
:
T
|
null
):
number
{
throw
new
Error
(
'
Method not implemented.
'
);
getListIndex
(
location
:
T
):
number
{
const
node
=
this
.
getCompressedNode
(
location
);
return
this
.
model
.
getListIndex
(
node
);
}
getListRenderCount
(
location
:
T
|
null
):
number
{
throw
new
Error
(
'
Method not implemented.
'
);
getListRenderCount
(
location
:
T
):
number
{
const
node
=
this
.
getCompressedNode
(
location
);
return
this
.
model
.
getListRenderCount
(
node
);
}
getNode
(
location
?:
T
|
null
|
undefined
):
ITreeNode
<
T
|
null
,
TFilterData
>
{
throw
new
Error
(
'
Method not implemented.
'
);
getNode
(
location
?:
T
|
null
|
undefined
):
ITreeNode
<
ICompressedTreeNode
<
T
>
|
null
,
TFilterData
>
{
if
(
typeof
location
===
'
undefined
'
)
{
return
this
.
model
.
getNode
();
}
const
node
=
this
.
getCompressedNode
(
location
);
return
this
.
model
.
getNode
(
node
);
}
getNodeLocation
(
node
:
ITreeNode
<
T
|
null
,
TFilterData
>
):
T
|
null
{
getNodeLocation
(
node
:
ITreeNode
<
ICompressedTreeNode
<
T
>
|
null
,
TFilterData
>
):
T
|
null
{
throw
new
Error
(
'
Method not implemented.
'
);
}
...
...
@@ -191,15 +198,15 @@ export class CompressedObjectTreeModel<T extends NonNullable<any>, TFilterData e
throw
new
Error
(
'
Method not implemented.
'
);
}
getParentElement
(
location
:
T
|
null
):
T
|
null
{
getParentElement
(
location
:
T
|
null
):
ICompressedTreeNode
<
T
>
|
null
{
throw
new
Error
(
'
Method not implemented.
'
);
}
getFirstElementChild
(
location
:
T
|
null
):
T
|
null
|
undefined
{
getFirstElementChild
(
location
:
T
|
null
):
ICompressedTreeNode
<
T
>
|
null
|
undefined
{
throw
new
Error
(
'
Method not implemented.
'
);
}
getLastElementAncestor
(
location
?:
T
|
null
|
undefined
):
T
|
null
|
undefined
{
getLastElementAncestor
(
location
?:
T
|
null
|
undefined
):
ICompressedTreeNode
<
T
>
|
null
|
undefined
{
throw
new
Error
(
'
Method not implemented.
'
);
}
...
...
@@ -222,4 +229,18 @@ export class CompressedObjectTreeModel<T extends NonNullable<any>, TFilterData e
refilter
():
void
{
this
.
model
.
refilter
();
}
private
getCompressedNode
(
element
:
T
|
null
):
ICompressedTreeNode
<
T
>
|
null
{
if
(
element
===
null
)
{
return
null
;
}
const
node
=
this
.
nodes
.
get
(
element
);
if
(
!
node
)
{
throw
new
Error
(
`Tree element not found:
${
element
}
`
);
}
return
node
;
}
}
src/vs/base/browser/ui/tree/objectTreeModel.ts
浏览文件 @
bbde6d2b
...
...
@@ -190,12 +190,12 @@ export class ObjectTreeModel<T extends NonNullable<any>, TFilterData extends Non
return
this
.
model
.
getLastElementAncestor
(
location
);
}
getListIndex
(
element
:
T
):
number
{
getListIndex
(
element
:
T
|
null
):
number
{
const
location
=
this
.
getElementLocation
(
element
);
return
this
.
model
.
getListIndex
(
location
);
}
getListRenderCount
(
element
:
T
):
number
{
getListRenderCount
(
element
:
T
|
null
):
number
{
const
location
=
this
.
getElementLocation
(
element
);
return
this
.
model
.
getListRenderCount
(
location
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录