Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
cece1a4f
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,体验更适合开发者的 AI 搜索 >>
提交
cece1a4f
编写于
12月 21, 2020
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use identity provider, some cleanup
上级
88c271c3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
31 addition
and
37 deletion
+31
-37
src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts
src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts
+7
-6
src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts
src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts
+1
-1
src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts
src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts
+8
-8
src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.ts
...trib/codeEditor/browser/outline/documentSymbolsOutline.ts
+4
-4
src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.ts
...b/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.ts
+3
-3
src/vs/workbench/contrib/notebook/browser/contrib/outline/notebooksOutline.ts
...trib/notebook/browser/contrib/outline/notebooksOutline.ts
+4
-11
src/vs/workbench/services/outline/browser/outline.ts
src/vs/workbench/services/outline/browser/outline.ts
+4
-4
未找到文件。
src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts
浏览文件 @
cece1a4f
...
...
@@ -64,9 +64,10 @@ class OutlineItem extends BreadcrumbsItem {
if
(
!
(
other
instanceof
OutlineItem
))
{
return
false
;
}
return
this
.
element
===
other
.
element
&&
this
.
options
.
showFileIcons
===
other
.
options
.
showFileIcons
&&
this
.
options
.
showSymbolIcons
===
other
.
options
.
showSymbolIcons
;
return
this
.
element
.
outline
.
config
.
identityProvider
.
getId
(
this
.
element
.
element
)
===
other
.
element
.
outline
.
config
.
identityProvider
.
getId
(
other
.
element
.
element
);
// return this.element === other.element &&
// this.options.showFileIcons === other.options.showFileIcons &&
// this.options.showSymbolIcons === other.options.showSymbolIcons;
}
render
(
container
:
HTMLElement
):
void
{
...
...
@@ -78,8 +79,8 @@ class OutlineItem extends BreadcrumbsItem {
return
;
}
const
templateId
=
outline
.
treeC
onfig
.
delegate
.
getTemplateId
(
element
);
const
renderer
=
outline
.
treeC
onfig
.
renderers
.
find
(
renderer
=>
renderer
.
templateId
===
templateId
);
const
templateId
=
outline
.
c
onfig
.
delegate
.
getTemplateId
(
element
);
const
renderer
=
outline
.
c
onfig
.
renderers
.
find
(
renderer
=>
renderer
.
templateId
===
templateId
);
if
(
!
renderer
)
{
container
.
innerText
=
'
<<NO RENDERER>>
'
;
return
;
...
...
@@ -477,7 +478,7 @@ export class BreadcrumbsControl {
this
.
_widget
.
setSelection
(
items
[
idx
+
1
],
BreadcrumbsControl
.
Payload_Pick
);
}
}
else
{
element
.
outline
.
reveal
InEditor
(
element
,
{
pinned
},
group
===
SIDE_GROUP
);
element
.
outline
.
reveal
(
element
,
{
pinned
},
group
===
SIDE_GROUP
);
}
}
...
...
src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts
浏览文件 @
cece1a4f
...
...
@@ -105,7 +105,7 @@ export class BreadcrumbsModel {
const
{
activeEntry
}
=
this
.
_currentOutline
;
if
(
activeEntry
)
{
for
(
let
element
of
this
.
_currentOutline
.
treeC
onfig
.
breadcrumbsDataSource
.
getBreadcrumbElements
(
activeEntry
))
{
for
(
let
element
of
this
.
_currentOutline
.
c
onfig
.
breadcrumbsDataSource
.
getBreadcrumbElements
(
activeEntry
))
{
result
.
push
(
new
OutlineElement2
(
element
,
this
.
_currentOutline
));
}
}
else
if
(
!
this
.
_currentOutline
.
isEmpty
)
{
...
...
src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts
浏览文件 @
cece1a4f
...
...
@@ -470,23 +470,23 @@ export class BreadcrumbsOutlinePicker extends BreadcrumbsPicker {
protected
_createTree
(
container
:
HTMLElement
,
input
:
OutlineElement2
)
{
const
{
treeC
onfig
}
=
input
.
outline
;
const
{
c
onfig
}
=
input
.
outline
;
return
<
WorkbenchDataTree
<
IOutline
<
any
>
,
any
,
FuzzyScore
>>
this
.
_instantiationService
.
createInstance
(
WorkbenchDataTree
,
'
BreadcrumbsOutlinePicker
'
,
container
,
treeC
onfig
.
delegate
,
treeC
onfig
.
renderers
,
treeC
onfig
.
treeDataSource
,
c
onfig
.
delegate
,
c
onfig
.
renderers
,
c
onfig
.
treeDataSource
,
{
collapseByDefault
:
true
,
expandOnlyOnTwistieClick
:
true
,
multipleSelectionSupport
:
false
,
sorter
:
this
.
_outlineComparator
,
identityProvider
:
treeConfig
.
ident
Provider
,
identityProvider
:
config
.
identity
Provider
,
keyboardNavigationLabelProvider
:
new
OutlineNavigationLabelProvider
(),
accessibilityProvider
:
treeC
onfig
.
options
.
accessibilityProvider
,
accessibilityProvider
:
c
onfig
.
options
.
accessibilityProvider
,
filter
:
this
.
_instantiationService
.
createInstance
(
OutlineFilter
,
'
breadcrumbs
'
)
}
);
...
...
@@ -521,12 +521,12 @@ export class BreadcrumbsOutlinePicker extends BreadcrumbsPicker {
protected
_previewElement
(
element
:
any
):
IDisposable
{
const
outline
:
IOutline
<
any
>
=
this
.
_tree
.
getInput
();
return
outline
.
preview
InEditor
(
element
);
return
outline
.
preview
(
element
);
}
async
_revealElement
(
element
:
any
,
options
:
IEditorOptions
,
sideBySide
:
boolean
):
Promise
<
boolean
>
{
const
outline
:
IOutline
<
any
>
=
this
.
_tree
.
getInput
();
await
outline
.
reveal
InEditor
(
element
,
options
,
sideBySide
);
await
outline
.
reveal
(
element
,
options
,
sideBySide
);
return
true
;
}
...
...
src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.ts
浏览文件 @
cece1a4f
...
...
@@ -46,7 +46,7 @@ class DocumentSymbolsOutline implements IOutline<DocumentSymbolItem> {
private
_outlineElementChain
:
Array
<
OutlineModel
|
OutlineGroup
|
OutlineElement
>
=
[];
private
_outlineDisposables
=
new
DisposableStore
();
readonly
treeC
onfig
:
OutlineTreeConfiguration
<
DocumentSymbolItem
>
;
readonly
c
onfig
:
OutlineTreeConfiguration
<
DocumentSymbolItem
>
;
constructor
(
private
readonly
_editor
:
ICodeEditor
,
...
...
@@ -56,7 +56,7 @@ class DocumentSymbolsOutline implements IOutline<DocumentSymbolItem> {
@
IInstantiationService
instantiationService
:
IInstantiationService
,
)
{
this
.
treeC
onfig
=
new
OutlineTreeConfiguration
(
this
.
c
onfig
=
new
OutlineTreeConfiguration
(
{
getBreadcrumbElements
:
()
=>
<
DocumentSymbolItem
[]
>
this
.
_outlineElementChain
.
filter
(
element
=>
!
(
element
instanceof
OutlineModel
))
},
...
...
@@ -139,7 +139,7 @@ class DocumentSymbolsOutline implements IOutline<DocumentSymbolItem> {
return
candidate
instanceof
OutlineModel
?
undefined
:
candidate
;
}
async
reveal
InEditor
(
entry
:
DocumentSymbolItem
,
options
:
IEditorOptions
,
sideBySide
:
boolean
):
Promise
<
void
>
{
async
reveal
(
entry
:
DocumentSymbolItem
,
options
:
IEditorOptions
,
sideBySide
:
boolean
):
Promise
<
void
>
{
if
(
entry
instanceof
OutlineElement
)
{
const
position
=
Range
.
getStartPosition
(
entry
.
symbol
.
selectionRange
);
this
.
_editor
.
revealPositionInCenterIfOutsideViewport
(
position
,
ScrollType
.
Immediate
);
...
...
@@ -161,7 +161,7 @@ class DocumentSymbolsOutline implements IOutline<DocumentSymbolItem> {
},
this
.
_editor
,
sideBySide
);
}
preview
InEditor
(
entry
:
DocumentSymbolItem
):
IDisposable
{
preview
(
entry
:
DocumentSymbolItem
):
IDisposable
{
if
(
!
(
entry
instanceof
OutlineElement
))
{
return
Disposable
.
None
;
}
...
...
src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.ts
浏览文件 @
cece1a4f
...
...
@@ -150,7 +150,7 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
disposables
.
add
(
outline
);
const
entries
=
Array
.
from
(
outline
.
treeC
onfig
.
quickPickDataSource
.
getQuickPickElements
());
const
entries
=
Array
.
from
(
outline
.
c
onfig
.
quickPickDataSource
.
getQuickPickElements
());
const
items
:
IGotoSymbolQuickPickItem
[]
=
entries
.
map
((
entry
,
idx
)
=>
{
return
{
...
...
@@ -167,7 +167,7 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
picker
.
hide
();
const
[
entry
]
=
picker
.
selectedItems
;
if
(
entry
&&
entries
[
entry
.
index
])
{
outline
.
reveal
InEditor
(
entries
[
entry
.
index
].
element
,
{},
false
);
outline
.
reveal
(
entries
[
entry
.
index
].
element
,
{},
false
);
}
}));
...
...
@@ -204,7 +204,7 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
disposables
.
add
(
picker
.
onDidChangeActive
(()
=>
{
const
[
entry
]
=
picker
.
activeItems
;
if
(
entry
&&
entries
[
entry
.
index
])
{
previewDisposable
.
value
=
outline
.
preview
InEditor
(
entries
[
entry
.
index
].
element
);
previewDisposable
.
value
=
outline
.
preview
(
entries
[
entry
.
index
].
element
);
}
else
{
previewDisposable
.
clear
();
}
...
...
src/vs/workbench/contrib/notebook/browser/contrib/outline/notebooksOutline.ts
浏览文件 @
cece1a4f
...
...
@@ -100,7 +100,7 @@ class NotebookCellOutline implements IOutline<OutlineEntry> {
private
_entries
:
OutlineEntry
[]
=
[];
private
readonly
_entriesDisposables
=
new
DisposableStore
();
readonly
treeC
onfig
:
OutlineTreeConfiguration
<
OutlineEntry
>
;
readonly
c
onfig
:
OutlineTreeConfiguration
<
OutlineEntry
>
;
constructor
(
private
readonly
_editor
:
NotebookEditor
,
...
...
@@ -131,7 +131,7 @@ class NotebookCellOutline implements IOutline<OutlineEntry> {
this
.
_computeActive
();
installSelectionListener
();
this
.
treeC
onfig
=
new
OutlineTreeConfiguration
<
OutlineEntry
>
(
this
.
c
onfig
=
new
OutlineTreeConfiguration
<
OutlineEntry
>
(
{
getBreadcrumbElements
:
(
element
)
=>
Iterable
.
single
(
element
)
},
{
getQuickPickElements
:
()
=>
this
.
_entries
.
map
(
entry
=>
({
element
:
entry
,
label
:
`$(
${
entry
.
icon
.
id
}
)
${
entry
.
label
}
`
,
ariaLabel
:
entry
.
label
}))
},
{
getChildren
:
parent
=>
parent
===
this
?
this
.
_entries
:
[]
},
...
...
@@ -209,14 +209,7 @@ class NotebookCellOutline implements IOutline<OutlineEntry> {
return
this
.
_activeEntry
;
}
async
revealInEditor
(
entry
:
OutlineEntry
,
options
:
IEditorOptions
,
sideBySide
:
boolean
):
Promise
<
void
>
{
//todo@jrieken focus cell
// const widget = this._editor.getControl();
// if (widget) {
// widget.revealInCenterIfOutsideViewport(entry.cell);
// widget.selectElement(entry.cell);
// widget.focusNotebookCell(entry.cell, entry.cell.cellKind === CellKind.Markdown ? 'container' : 'editor');
// }
async
reveal
(
entry
:
OutlineEntry
,
options
:
IEditorOptions
,
sideBySide
:
boolean
):
Promise
<
void
>
{
await
this
.
_editorService
.
openEditor
({
resource
:
entry
.
cell
.
uri
,
...
...
@@ -224,7 +217,7 @@ class NotebookCellOutline implements IOutline<OutlineEntry> {
},
sideBySide
?
SIDE_GROUP
:
undefined
);
}
preview
InEditor
(
entry
:
OutlineEntry
):
IDisposable
{
preview
(
entry
:
OutlineEntry
):
IDisposable
{
const
widget
=
this
.
_editor
.
getControl
();
if
(
!
widget
)
{
return
Disposable
.
None
;
...
...
src/vs/workbench/services/outline/browser/outline.ts
浏览文件 @
cece1a4f
...
...
@@ -45,7 +45,7 @@ export class OutlineTreeConfiguration<E> {
readonly
treeDataSource
:
IDataSource
<
IOutline
<
E
>
,
E
>
,
readonly
delegate
:
IListVirtualDelegate
<
E
>
,
readonly
renderers
:
ITreeRenderer
<
E
,
FuzzyScore
,
any
>
[],
readonly
identProvider
:
IIdentityProvider
<
E
>
,
readonly
ident
ity
Provider
:
IIdentityProvider
<
E
>
,
readonly
options
:
IWorkbenchDataTreeOptions
<
E
,
FuzzyScore
>
,
)
{
}
}
...
...
@@ -54,7 +54,7 @@ export interface IOutline<E> {
dispose
():
void
;
readonly
treeC
onfig
:
OutlineTreeConfiguration
<
E
>
readonly
c
onfig
:
OutlineTreeConfiguration
<
E
>
readonly
onDidChange
:
Event
<
this
>
;
...
...
@@ -62,6 +62,6 @@ export interface IOutline<E> {
readonly
activeEntry
:
E
|
undefined
;
readonly
onDidChangeActiveEntry
:
Event
<
this
>
reveal
InEditor
(
entry
:
E
,
options
:
IEditorOptions
,
sideBySide
:
boolean
):
Promise
<
void
>
|
void
;
preview
InEditor
(
entry
:
E
):
IDisposable
;
reveal
(
entry
:
E
,
options
:
IEditorOptions
,
sideBySide
:
boolean
):
Promise
<
void
>
|
void
;
preview
(
entry
:
E
):
IDisposable
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录