Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
20f06ed0
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,发现更多精彩内容 >>
提交
20f06ed0
编写于
4月 17, 2020
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make OutlineGroup fit for being used with other things than providers, #95234
上级
88e98034
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
9 addition
and
9 deletion
+9
-9
src/vs/editor/contrib/documentSymbols/outlineModel.ts
src/vs/editor/contrib/documentSymbols/outlineModel.ts
+4
-4
src/vs/editor/contrib/documentSymbols/outlineTree.ts
src/vs/editor/contrib/documentSymbols/outlineTree.ts
+4
-4
src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts
src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts
+1
-1
未找到文件。
src/vs/editor/contrib/documentSymbols/outlineModel.ts
浏览文件 @
20f06ed0
...
@@ -120,14 +120,14 @@ export class OutlineGroup extends TreeElement {
...
@@ -120,14 +120,14 @@ export class OutlineGroup extends TreeElement {
constructor
(
constructor
(
readonly
id
:
string
,
readonly
id
:
string
,
public
parent
:
TreeElement
|
undefined
,
public
parent
:
TreeElement
|
undefined
,
readonly
provider
:
DocumentSymbolProvider
,
readonly
label
:
string
,
readonly
providerIndex
:
number
,
readonly
order
:
number
,
)
{
)
{
super
();
super
();
}
}
adopt
(
parent
:
TreeElement
):
OutlineGroup
{
adopt
(
parent
:
TreeElement
):
OutlineGroup
{
let
res
=
new
OutlineGroup
(
this
.
id
,
parent
,
this
.
provider
,
this
.
providerIndex
);
let
res
=
new
OutlineGroup
(
this
.
id
,
parent
,
this
.
label
,
this
.
order
);
for
(
const
[
key
,
value
]
of
this
.
children
)
{
for
(
const
[
key
,
value
]
of
this
.
children
)
{
res
.
children
.
set
(
key
,
value
.
adopt
(
res
));
res
.
children
.
set
(
key
,
value
.
adopt
(
res
));
}
}
...
@@ -320,7 +320,7 @@ export class OutlineModel extends TreeElement {
...
@@ -320,7 +320,7 @@ export class OutlineModel extends TreeElement {
const
promises
=
provider
.
map
((
provider
,
index
)
=>
{
const
promises
=
provider
.
map
((
provider
,
index
)
=>
{
let
id
=
TreeElement
.
findId
(
`provider_
${
index
}
`
,
result
);
let
id
=
TreeElement
.
findId
(
`provider_
${
index
}
`
,
result
);
let
group
=
new
OutlineGroup
(
id
,
result
,
provider
,
index
);
let
group
=
new
OutlineGroup
(
id
,
result
,
provider
.
displayName
??
'
Unknown Outline Provider
'
,
index
);
return
Promise
.
resolve
(
provider
.
provideDocumentSymbols
(
result
.
textModel
,
cts
.
token
)).
then
(
result
=>
{
return
Promise
.
resolve
(
provider
.
provideDocumentSymbols
(
result
.
textModel
,
cts
.
token
)).
then
(
result
=>
{
for
(
const
info
of
result
||
[])
{
for
(
const
info
of
result
||
[])
{
...
...
src/vs/editor/contrib/documentSymbols/outlineTree.ts
浏览文件 @
20f06ed0
...
@@ -32,7 +32,7 @@ export class OutlineNavigationLabelProvider implements IKeyboardNavigationLabelP
...
@@ -32,7 +32,7 @@ export class OutlineNavigationLabelProvider implements IKeyboardNavigationLabelP
getKeyboardNavigationLabel
(
element
:
OutlineItem
):
{
toString
():
string
;
}
{
getKeyboardNavigationLabel
(
element
:
OutlineItem
):
{
toString
():
string
;
}
{
if
(
element
instanceof
OutlineGroup
)
{
if
(
element
instanceof
OutlineGroup
)
{
return
element
.
provider
.
displayName
||
element
.
id
;
return
element
.
label
;
}
else
{
}
else
{
return
element
.
symbol
.
name
;
return
element
.
symbol
.
name
;
}
}
...
@@ -43,7 +43,7 @@ export class OutlineAccessibilityProvider implements IListAccessibilityProvider<
...
@@ -43,7 +43,7 @@ export class OutlineAccessibilityProvider implements IListAccessibilityProvider<
getAriaLabel
(
element
:
OutlineItem
):
string
|
null
{
getAriaLabel
(
element
:
OutlineItem
):
string
|
null
{
if
(
element
instanceof
OutlineGroup
)
{
if
(
element
instanceof
OutlineGroup
)
{
return
element
.
provider
.
displayName
||
element
.
id
;
return
element
.
label
;
}
else
{
}
else
{
return
element
.
symbol
.
name
;
return
element
.
symbol
.
name
;
}
}
...
@@ -102,7 +102,7 @@ export class OutlineGroupRenderer implements ITreeRenderer<OutlineGroup, FuzzySc
...
@@ -102,7 +102,7 @@ export class OutlineGroupRenderer implements ITreeRenderer<OutlineGroup, FuzzySc
renderElement
(
node
:
ITreeNode
<
OutlineGroup
,
FuzzyScore
>
,
index
:
number
,
template
:
OutlineGroupTemplate
):
void
{
renderElement
(
node
:
ITreeNode
<
OutlineGroup
,
FuzzyScore
>
,
index
:
number
,
template
:
OutlineGroupTemplate
):
void
{
template
.
label
.
set
(
template
.
label
.
set
(
node
.
element
.
provider
.
displayName
||
localize
(
'
provider
'
,
"
Outline Provider
"
)
,
node
.
element
.
label
,
createMatches
(
node
.
filterData
)
createMatches
(
node
.
filterData
)
);
);
}
}
...
@@ -324,7 +324,7 @@ export class OutlineItemComparator implements ITreeSorter<OutlineItem> {
...
@@ -324,7 +324,7 @@ export class OutlineItemComparator implements ITreeSorter<OutlineItem> {
compare
(
a
:
OutlineItem
,
b
:
OutlineItem
):
number
{
compare
(
a
:
OutlineItem
,
b
:
OutlineItem
):
number
{
if
(
a
instanceof
OutlineGroup
&&
b
instanceof
OutlineGroup
)
{
if
(
a
instanceof
OutlineGroup
&&
b
instanceof
OutlineGroup
)
{
return
a
.
providerIndex
-
b
.
providerIndex
;
return
a
.
order
-
b
.
order
;
}
else
if
(
a
instanceof
OutlineElement
&&
b
instanceof
OutlineElement
)
{
}
else
if
(
a
instanceof
OutlineElement
&&
b
instanceof
OutlineElement
)
{
if
(
this
.
type
===
OutlineSortOrder
.
ByKind
)
{
if
(
this
.
type
===
OutlineSortOrder
.
ByKind
)
{
...
...
src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts
浏览文件 @
20f06ed0
...
@@ -104,7 +104,7 @@ class Item extends BreadcrumbsItem {
...
@@ -104,7 +104,7 @@ class Item extends BreadcrumbsItem {
}
else
if
(
this
.
element
instanceof
OutlineGroup
)
{
}
else
if
(
this
.
element
instanceof
OutlineGroup
)
{
// provider
// provider
let
label
=
new
IconLabel
(
container
);
let
label
=
new
IconLabel
(
container
);
label
.
setLabel
(
this
.
element
.
provider
.
displayName
||
''
);
label
.
setLabel
(
this
.
element
.
label
);
this
.
_disposables
.
add
(
label
);
this
.
_disposables
.
add
(
label
);
}
else
if
(
this
.
element
instanceof
OutlineElement
)
{
}
else
if
(
this
.
element
instanceof
OutlineElement
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录