Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
d1206c6c
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,发现更多精彩内容 >>
未验证
提交
d1206c6c
编写于
10月 23, 2018
作者:
J
Johannes Rieken
提交者:
GitHub
10月 23, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #61420 from ryanclarke/master
Add sort option for breadcrumb symbol trees
上级
aca47467
096a54b9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
4 deletion
+33
-4
src/vs/platform/telemetry/common/telemetryUtils.ts
src/vs/platform/telemetry/common/telemetryUtils.ts
+1
-0
src/vs/workbench/browser/parts/editor/breadcrumbs.ts
src/vs/workbench/browser/parts/editor/breadcrumbs.ts
+12
-0
src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts
src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts
+20
-4
未找到文件。
src/vs/platform/telemetry/common/telemetryUtils.ts
浏览文件 @
d1206c6c
...
...
@@ -157,6 +157,7 @@ const configurationValueWhitelist = [
'
breadcrumbs.enabled
'
,
'
breadcrumbs.filePath
'
,
'
breadcrumbs.symbolPath
'
,
'
breadcrumbs.symbolSortOrder
'
,
'
breadcrumbs.useQuickPick
'
,
'
explorer.openEditors.visible
'
,
'
extensions.autoUpdate
'
,
...
...
src/vs/workbench/browser/parts/editor/breadcrumbs.ts
浏览文件 @
d1206c6c
...
...
@@ -70,6 +70,7 @@ export abstract class BreadcrumbsConfig<T> {
static
UseQuickPick
=
BreadcrumbsConfig
.
_stub
<
boolean
>
(
'
breadcrumbs.useQuickPick
'
);
static
FilePath
=
BreadcrumbsConfig
.
_stub
<
'
on
'
|
'
off
'
|
'
last
'
>
(
'
breadcrumbs.filePath
'
);
static
SymbolPath
=
BreadcrumbsConfig
.
_stub
<
'
on
'
|
'
off
'
|
'
last
'
>
(
'
breadcrumbs.symbolPath
'
);
static
SymbolSortOrder
=
BreadcrumbsConfig
.
_stub
<
'
position
'
|
'
name
'
|
'
type
'
>
(
'
breadcrumbs.symbolSortOrder
'
);
static
FilterOnType
=
BreadcrumbsConfig
.
_stub
<
boolean
>
(
'
breadcrumbs.filterOnType
'
);
static
FileExcludes
=
BreadcrumbsConfig
.
_stub
<
glob
.
IExpression
>
(
'
files.exclude
'
);
...
...
@@ -142,6 +143,17 @@ Registry.as<IConfigurationRegistry>(Extensions.Configuration).registerConfigurat
localize
(
'
symbolpath.last
'
,
"
Only show the current symbol in the breadcrumbs view.
"
),
]
},
'
breadcrumbs.symbolSortOrder
'
:
{
description
:
localize
(
'
symbolSortOrder
'
,
"
Controls how symbols are sorted in the breadcrumbs outline view.
"
),
type
:
'
string
'
,
default
:
'
position
'
,
enum
:
[
'
position
'
,
'
name
'
,
'
type
'
],
enumDescriptions
:
[
localize
(
'
symbolSortOrder.position
'
,
"
Show symbol outline in file position order.
"
),
localize
(
'
symbolSortOrder.name
'
,
"
Show symbol outline in alphabetical order.
"
),
localize
(
'
symbolSortOrder.type
'
,
"
Show symbol outline in symbol type order.
"
),
]
},
// 'breadcrumbs.filterOnType': {
// description: localize('filterOnType', "Controls whether the breadcrumb picker filters or highlights when typing."),
// type: 'boolean',
...
...
src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts
浏览文件 @
d1206c6c
...
...
@@ -18,7 +18,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
IDataSource
,
IFilter
,
IRenderer
,
ISorter
,
ITree
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
'
vs/css!./media/breadcrumbscontrol
'
;
import
{
OutlineElement
,
OutlineModel
,
TreeElement
}
from
'
vs/editor/contrib/documentSymbols/outlineModel
'
;
import
{
OutlineDataSource
,
OutlineItemComparator
,
OutlineRenderer
}
from
'
vs/editor/contrib/documentSymbols/outlineTree
'
;
import
{
OutlineDataSource
,
OutlineItemComparator
,
OutlineRenderer
,
OutlineItemCompareType
}
from
'
vs/editor/contrib/documentSymbols/outlineTree
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
FileKind
,
IFileService
,
IFileStat
}
from
'
vs/platform/files/common/files
'
;
...
...
@@ -52,6 +52,7 @@ export abstract class BreadcrumbsPicker {
protected
readonly
_treeContainer
:
HTMLDivElement
;
protected
readonly
_tree
:
HighlightingWorkbenchTree
;
protected
readonly
_focus
:
dom
.
IFocusTracker
;
protected
readonly
_symbolSortOrder
:
BreadcrumbsConfig
<
'
position
'
|
'
name
'
|
'
type
'
>
;
private
_layoutInfo
:
ILayoutInfo
;
private
readonly
_onDidPickElement
=
new
Emitter
<
{
target
:
any
,
payload
:
any
}
>
();
...
...
@@ -88,14 +89,16 @@ export abstract class BreadcrumbsPicker {
this
.
_treeContainer
.
style
.
boxShadow
=
`0px 5px 8px
${
this
.
_themeService
.
getTheme
().
getColor
(
widgetShadow
)}
`
;
this
.
_domNode
.
appendChild
(
this
.
_treeContainer
);
this
.
_symbolSortOrder
=
BreadcrumbsConfig
.
SymbolSortOrder
.
bindTo
(
this
.
_configurationService
);
const
filterConfig
=
BreadcrumbsConfig
.
FilterOnType
.
bindTo
(
this
.
_configurationService
);
this
.
_disposables
.
push
(
filterConfig
);
const
treeCon
if
g
=
this
.
_completeTreeConfiguration
({
dataSource
:
undefined
,
renderer
:
undefined
,
highlighter
:
undefined
});
const
treeCon
fi
g
=
this
.
_completeTreeConfiguration
({
dataSource
:
undefined
,
renderer
:
undefined
,
highlighter
:
undefined
});
this
.
_tree
=
this
.
_instantiationService
.
createInstance
(
HighlightingWorkbenchTree
,
this
.
_treeContainer
,
treeCon
if
g
,
treeCon
fi
g
,
<
IHighlightingTreeOptions
>
{
useShadows
:
false
,
filterOnType
:
filterConfig
.
getValue
(),
showTwistie
:
false
,
twistiePixels
:
12
},
{
placeholder
:
localize
(
'
placeholder
'
,
"
Find
"
)
}
);
...
...
@@ -144,6 +147,7 @@ export abstract class BreadcrumbsPicker {
this
.
_onDidPickElement
.
dispose
();
this
.
_tree
.
dispose
();
this
.
_focus
.
dispose
();
this
.
_symbolSortOrder
.
dispose
();
}
setInput
(
input
:
any
,
maxHeight
:
number
,
width
:
number
,
arrowSize
:
number
,
arrowOffset
:
number
):
void
{
...
...
@@ -464,7 +468,7 @@ export class BreadcrumbsOutlinePicker extends BreadcrumbsPicker {
protected
_completeTreeConfiguration
(
config
:
IHighlightingTreeConfiguration
):
IHighlightingTreeConfiguration
{
config
.
dataSource
=
this
.
_instantiationService
.
createInstance
(
OutlineDataSource
);
config
.
renderer
=
this
.
_instantiationService
.
createInstance
(
OutlineRenderer
);
config
.
sorter
=
new
OutlineItemComparator
();
config
.
sorter
=
new
OutlineItemComparator
(
this
.
_getOutlineItemComparator
()
);
config
.
highlighter
=
new
OutlineHighlighter
();
return
config
;
}
...
...
@@ -477,6 +481,18 @@ export class BreadcrumbsOutlinePicker extends BreadcrumbsPicker {
return
element
;
}
}
private
_getOutlineItemComparator
():
OutlineItemCompareType
{
switch
(
this
.
_symbolSortOrder
.
getValue
())
{
case
'
name
'
:
return
OutlineItemCompareType
.
ByName
;
case
'
type
'
:
return
OutlineItemCompareType
.
ByKind
;
case
'
position
'
:
default
:
return
OutlineItemCompareType
.
ByPosition
;
}
}
}
//#endregion
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录