Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
475d3464
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 搜索 >>
提交
475d3464
编写于
1月 13, 2021
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Have single outline config and let outline creator know for what they create outlines
上级
b4e4bd16
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
54 addition
and
88 deletion
+54
-88
src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts
src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts
+2
-2
src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts
src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts
+3
-3
src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts
src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts
+1
-1
src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.ts
...trib/codeEditor/browser/outline/documentSymbolsOutline.ts
+14
-27
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/notebookOutline.ts
...ntrib/notebook/browser/contrib/outline/notebookOutline.ts
+4
-18
src/vs/workbench/contrib/outline/browser/outlinePane.ts
src/vs/workbench/contrib/outline/browser/outlinePane.ts
+7
-7
src/vs/workbench/services/outline/browser/outline.ts
src/vs/workbench/services/outline/browser/outline.ts
+17
-24
src/vs/workbench/services/outline/browser/outlineService.ts
src/vs/workbench/services/outline/browser/outlineService.ts
+3
-3
未找到文件。
src/vs/workbench/browser/parts/editor/breadcrumbsControl.ts
浏览文件 @
475d3464
...
...
@@ -76,8 +76,8 @@ class OutlineItem extends BreadcrumbsItem {
return
;
}
const
templateId
=
outline
.
breadcrumbsC
onfig
.
delegate
.
getTemplateId
(
element
);
const
renderer
=
outline
.
breadcrumbsC
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
;
...
...
src/vs/workbench/browser/parts/editor/breadcrumbsModel.ts
浏览文件 @
475d3464
...
...
@@ -15,7 +15,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import
{
BreadcrumbsConfig
}
from
'
vs/workbench/browser/parts/editor/breadcrumbs
'
;
import
{
FileKind
}
from
'
vs/platform/files/common/files
'
;
import
{
withNullAsUndefined
}
from
'
vs/base/common/types
'
;
import
{
IOutline
,
IOutlineService
}
from
'
vs/workbench/services/outline/browser/outline
'
;
import
{
IOutline
,
IOutlineService
,
OutlineTarget
}
from
'
vs/workbench/services/outline/browser/outline
'
;
import
{
IEditorPane
}
from
'
vs/workbench/common/editor
'
;
export
class
FileElement
{
...
...
@@ -104,7 +104,7 @@ export class BreadcrumbsModel {
}
let
didAddOutlineElement
=
false
;
for
(
let
element
of
this
.
_currentOutline
.
value
.
breadcrumbsC
onfig
.
breadcrumbsDataSource
.
getBreadcrumbElements
())
{
for
(
let
element
of
this
.
_currentOutline
.
value
.
c
onfig
.
breadcrumbsDataSource
.
getBreadcrumbElements
())
{
result
.
push
(
new
OutlineElement2
(
element
,
this
.
_currentOutline
.
value
));
didAddOutlineElement
=
true
;
}
...
...
@@ -154,7 +154,7 @@ export class BreadcrumbsModel {
this
.
_outlineDisposables
.
clear
();
this
.
_outlineDisposables
.
add
(
toDisposable
(()
=>
newCts
.
dispose
(
true
)));
this
.
_outlineService
.
createOutline
(
editor
,
newCts
.
token
).
then
(
outline
=>
{
this
.
_outlineService
.
createOutline
(
editor
,
OutlineTarget
.
Breadcrumbs
,
newCts
.
token
).
then
(
outline
=>
{
if
(
newCts
.
token
.
isCancellationRequested
)
{
// cancelled: dispose new outline and reset
outline
?.
dispose
();
...
...
src/vs/workbench/browser/parts/editor/breadcrumbsPicker.ts
浏览文件 @
475d3464
...
...
@@ -472,7 +472,7 @@ export class BreadcrumbsOutlinePicker extends BreadcrumbsPicker {
protected
_createTree
(
container
:
HTMLElement
,
input
:
OutlineElement2
)
{
const
{
breadcrumbsConfig
:
config
}
=
input
.
outline
;
const
{
config
}
=
input
.
outline
;
return
<
WorkbenchDataTree
<
IOutline
<
any
>
,
any
,
FuzzyScore
>>
this
.
_instantiationService
.
createInstance
(
WorkbenchDataTree
,
...
...
src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline.ts
浏览文件 @
475d3464
...
...
@@ -5,7 +5,7 @@
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
Disposable
,
DisposableStore
,
IDisposable
,
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IBreadcrumbsDataSource
,
IOutline
,
IOutline
BreadcrumbsConfig
,
IOutlineCreator
,
IOutlineQuickPickConfig
,
IOutlineService
,
IOutlineTreeConfig
,
OutlineChangeEvent
,
OutlineConfigKeys
,
}
from
'
vs/workbench/services/outline/browser/outline
'
;
import
{
IBreadcrumbsDataSource
,
IOutline
,
IOutline
Creator
,
IOutlineListConfig
,
IOutlineService
,
OutlineChangeEvent
,
OutlineConfigKeys
,
OutlineTarget
,
}
from
'
vs/workbench/services/outline/browser/outline
'
;
import
{
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
LifecyclePhase
}
from
'
vs/workbench/services/lifecycle/common/lifecycle
'
;
...
...
@@ -115,9 +115,7 @@ class DocumentSymbolsOutline implements IOutline<DocumentSymbolItem> {
private
readonly
_breadcrumbsDataSource
:
DocumentSymbolBreadcrumbsSource
;
readonly
breadcrumbsConfig
:
IOutlineBreadcrumbsConfig
<
DocumentSymbolItem
>
;
readonly
treeConfig
:
IOutlineTreeConfig
<
DocumentSymbolItem
>
;
readonly
quickPickConfig
:
IOutlineQuickPickConfig
<
DocumentSymbolItem
>
;
readonly
config
:
IOutlineListConfig
<
DocumentSymbolItem
>
;
readonly
outlineKind
=
'
documentSymbols
'
;
...
...
@@ -132,6 +130,7 @@ class DocumentSymbolsOutline implements IOutline<DocumentSymbolItem> {
constructor
(
private
readonly
_editor
:
ICodeEditor
,
target
:
OutlineTarget
,
firstLoadBarrier
:
Barrier
,
@
ICodeEditorService
private
readonly
_codeEditorService
:
ICodeEditorService
,
@
IConfigurationService
private
readonly
_configurationService
:
IConfigurationService
,
...
...
@@ -161,37 +160,25 @@ class DocumentSymbolsOutline implements IOutline<DocumentSymbolItem> {
multipleSelectionSupport
:
false
,
identityProvider
:
new
DocumentSymbolIdentityProvider
(),
keyboardNavigationLabelProvider
:
new
DocumentSymbolNavigationLabelProvider
(),
accessibilityProvider
:
new
DocumentSymbolAccessibilityProvider
(
localize
(
'
document
'
,
"
Document Symbols
"
)),
filter
:
target
===
OutlineTarget
.
OutlinePane
?
instantiationService
.
createInstance
(
DocumentSymbolFilter
,
'
outline
'
)
:
target
===
OutlineTarget
.
Breadcrumbs
?
instantiationService
.
createInstance
(
DocumentSymbolFilter
,
'
breadcrumbs
'
)
:
undefined
};
this
.
breadcrumbsC
onfig
=
{
this
.
c
onfig
=
{
breadcrumbsDataSource
:
this
.
_breadcrumbsDataSource
,
delegate
,
renderers
,
treeDataSource
,
comparator
,
options
:
{
...
options
,
filter
:
instantiationService
.
createInstance
(
DocumentSymbolFilter
,
'
breadcrumbs
'
),
accessibilityProvider
:
new
DocumentSymbolAccessibilityProvider
(
localize
(
'
breadcrumbs
'
,
"
Breadcrumbs
"
)),
}
};
this
.
treeConfig
=
{
delegate
,
renderers
,
treeDataSource
,
comparator
,
options
:
{
...
options
,
filter
:
instantiationService
.
createInstance
(
DocumentSymbolFilter
,
'
outline
'
),
accessibilityProvider
:
new
DocumentSymbolAccessibilityProvider
(
localize
(
'
outline
'
,
"
Outline
"
)),
}
};
this
.
quickPickConfig
=
{
options
,
quickPickDataSource
:
{
getQuickPickElements
:
()
=>
{
throw
new
Error
(
'
not implemented
'
);
}
}
};
// update as language, model, providers changes
this
.
_disposables
.
add
(
DocumentSymbolProviderRegistry
.
onDidChange
(
_
=>
this
.
_createOutline
()));
this
.
_disposables
.
add
(
this
.
_editor
.
onDidChangeModel
(
_
=>
this
.
_createOutline
()));
...
...
@@ -426,7 +413,7 @@ class DocumentSymbolsOutlineCreator implements IOutlineCreator<IEditorPane, Docu
return
isCodeEditor
(
ctrl
)
||
isDiffEditor
(
ctrl
);
}
async
createOutline
(
pane
:
IEditorPane
,
token
:
CancellationToken
):
Promise
<
IOutline
<
DocumentSymbolItem
>
|
undefined
>
{
async
createOutline
(
pane
:
IEditorPane
,
t
arget
:
OutlineTarget
,
_t
oken
:
CancellationToken
):
Promise
<
IOutline
<
DocumentSymbolItem
>
|
undefined
>
{
const
control
=
pane
.
getControl
();
let
editor
:
ICodeEditor
|
undefined
;
if
(
isCodeEditor
(
control
))
{
...
...
@@ -438,7 +425,7 @@ class DocumentSymbolsOutlineCreator implements IOutlineCreator<IEditorPane, Docu
return
undefined
;
}
const
firstLoadBarrier
=
new
Barrier
();
const
result
=
this
.
_instantiationService
.
createInstance
(
DocumentSymbolsOutline
,
editor
,
firstLoadBarrier
);
const
result
=
this
.
_instantiationService
.
createInstance
(
DocumentSymbolsOutline
,
editor
,
target
,
firstLoadBarrier
);
await
firstLoadBarrier
.
wait
();
return
result
;
}
...
...
src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.ts
浏览文件 @
475d3464
...
...
@@ -26,7 +26,7 @@ import { onUnexpectedError } from 'vs/base/common/errors';
import
{
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
KeybindingWeight
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
IQuickAccessTextEditorContext
}
from
'
vs/editor/contrib/quickAccess/editorNavigationQuickAccess
'
;
import
{
IOutlineService
}
from
'
vs/workbench/services/outline/browser/outline
'
;
import
{
IOutlineService
,
OutlineTarget
}
from
'
vs/workbench/services/outline/browser/outline
'
;
import
{
isCompositeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
export
class
GotoSymbolQuickAccessProvider
extends
AbstractGotoSymbolQuickAccessProvider
{
...
...
@@ -143,7 +143,7 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
picker
.
busy
=
true
;
this
.
outlineService
.
createOutline
(
pane
,
cts
.
token
).
then
(
outline
=>
{
this
.
outlineService
.
createOutline
(
pane
,
OutlineTarget
.
QuickPick
,
cts
.
token
).
then
(
outline
=>
{
if
(
!
outline
)
{
return
;
...
...
@@ -162,7 +162,7 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
}
}));
const
entries
=
Array
.
from
(
outline
.
quickPickC
onfig
.
quickPickDataSource
.
getQuickPickElements
());
const
entries
=
Array
.
from
(
outline
.
c
onfig
.
quickPickDataSource
.
getQuickPickElements
());
const
items
:
IGotoSymbolQuickPickItem
[]
=
entries
.
map
((
entry
,
idx
)
=>
{
return
{
...
...
src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.ts
浏览文件 @
475d3464
...
...
@@ -11,7 +11,7 @@ import { IThemeService, ThemeIcon } from 'vs/platform/theme/common/themeService'
import
{
ICellViewModel
}
from
'
vs/workbench/contrib/notebook/browser/notebookBrowser
'
;
import
{
NotebookEditor
}
from
'
vs/workbench/contrib/notebook/browser/notebookEditor
'
;
import
{
CellKind
}
from
'
vs/workbench/contrib/notebook/common/notebookCommon
'
;
import
{
IOutline
,
IOutline
BreadcrumbsConfig
,
IOutlineComparator
,
IOutlineCreator
,
IOutlineQuickPickConfig
,
IOutlineService
,
IOutlineTreeConfig
,
IQuickPickDataSource
,
IQuickPickOutlineElement
,
OutlineChangeEvent
,
OutlineConfigKeys
}
from
'
vs/workbench/services/outline/browser/outline
'
;
import
{
IOutline
,
IOutline
Comparator
,
IOutlineCreator
,
IOutlineListConfig
,
IOutlineService
,
IQuickPickDataSource
,
IQuickPickOutlineElement
,
OutlineChangeEvent
,
OutlineConfigKeys
}
from
'
vs/workbench/services/outline/browser/outline
'
;
import
{
IWorkbenchContributionsRegistry
,
Extensions
as
WorkbenchExtensions
}
from
'
vs/workbench/common/contributions
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
LifecyclePhase
}
from
'
vs/workbench/services/lifecycle/common/lifecycle
'
;
...
...
@@ -278,10 +278,7 @@ class NotebookCellOutline implements IOutline<OutlineEntry> {
private
_activeEntry
?:
OutlineEntry
;
private
readonly
_entriesDisposables
=
new
DisposableStore
();
readonly
breadcrumbsConfig
:
IOutlineBreadcrumbsConfig
<
OutlineEntry
>
;
readonly
treeConfig
:
IOutlineTreeConfig
<
OutlineEntry
>
;
readonly
quickPickConfig
:
IOutlineQuickPickConfig
<
OutlineEntry
>
;
readonly
config
:
IOutlineListConfig
<
OutlineEntry
>
;
readonly
outlineKind
=
'
notebookCells
'
;
get
activeElement
():
OutlineEntry
|
undefined
{
...
...
@@ -330,7 +327,7 @@ class NotebookCellOutline implements IOutline<OutlineEntry> {
const
renderers
=
[
instantiationService
.
createInstance
(
NotebookOutlineRenderer
)];
const
comparator
=
new
NotebookComparator
();
this
.
breadcrumbsC
onfig
=
{
this
.
c
onfig
=
{
breadcrumbsDataSource
:
{
getBreadcrumbElements
:
()
=>
{
let
result
:
OutlineEntry
[]
=
[];
...
...
@@ -342,24 +339,13 @@ class NotebookCellOutline implements IOutline<OutlineEntry> {
return
result
;
}
},
quickPickDataSource
:
instantiationService
.
createInstance
(
NotebookQuickPickProvider
,
()
=>
this
.
_entries
),
treeDataSource
,
delegate
,
renderers
,
comparator
,
options
};
this
.
treeConfig
=
{
treeDataSource
,
delegate
,
renderers
,
comparator
,
options
};
this
.
quickPickConfig
=
{
quickPickDataSource
:
instantiationService
.
createInstance
(
NotebookQuickPickProvider
,
()
=>
this
.
_entries
),
};
}
dispose
():
void
{
...
...
src/vs/workbench/contrib/outline/browser/outlinePane.ts
浏览文件 @
475d3464
...
...
@@ -31,7 +31,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import
{
Codicon
}
from
'
vs/base/common/codicons
'
;
import
{
MenuId
,
registerAction2
}
from
'
vs/platform/actions/common/actions
'
;
import
{
OutlineSortOrder
,
OutlineViewState
}
from
'
./outlineViewState
'
;
import
{
IOutline
,
IOutlineComparator
,
IOutlineService
}
from
'
vs/workbench/services/outline/browser/outline
'
;
import
{
IOutline
,
IOutlineComparator
,
IOutlineService
,
OutlineTarget
}
from
'
vs/workbench/services/outline/browser/outline
'
;
import
{
EditorResourceAccessor
,
IEditorPane
}
from
'
vs/workbench/common/editor
'
;
import
{
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
...
...
@@ -203,7 +203,7 @@ export class OutlinePane extends ViewPane {
const
cts
=
new
CancellationTokenSource
();
this
.
_editorDisposables
.
add
(
toDisposable
(()
=>
cts
.
dispose
(
true
)));
const
newOutline
=
await
this
.
_outlineService
.
createOutline
(
pane
,
cts
.
token
);
const
newOutline
=
await
this
.
_outlineService
.
createOutline
(
pane
,
OutlineTarget
.
OutlinePane
,
cts
.
token
);
loadingMessage
?.
dispose
();
if
(
!
newOutline
)
{
...
...
@@ -213,17 +213,17 @@ export class OutlinePane extends ViewPane {
this
.
_editorDisposables
.
add
(
newOutline
);
this
.
_progressBar
.
stop
().
hide
();
const
sorter
=
new
OutlineTreeSorter
(
newOutline
.
treeC
onfig
.
comparator
,
this
.
_outlineViewState
.
sortBy
);
const
sorter
=
new
OutlineTreeSorter
(
newOutline
.
c
onfig
.
comparator
,
this
.
_outlineViewState
.
sortBy
);
const
tree
=
<
WorkbenchDataTree
<
IOutline
<
any
>
|
undefined
,
any
,
FuzzyScore
>>
this
.
_instantiationService
.
createInstance
(
WorkbenchDataTree
,
'
OutlinePane
'
,
this
.
_treeContainer
,
newOutline
.
treeC
onfig
.
delegate
,
newOutline
.
treeC
onfig
.
renderers
,
newOutline
.
treeC
onfig
.
treeDataSource
,
newOutline
.
c
onfig
.
delegate
,
newOutline
.
c
onfig
.
renderers
,
newOutline
.
c
onfig
.
treeDataSource
,
{
...
newOutline
.
treeC
onfig
.
options
,
...
newOutline
.
c
onfig
.
options
,
sorter
,
openOnSingleClick
:
true
,
expandOnlyOnTwistieClick
:
true
,
...
...
src/vs/workbench/services/outline/browser/outline.ts
浏览文件 @
475d3464
...
...
@@ -16,17 +16,23 @@ import { IEditorPane } from 'vs/workbench/common/editor';
export
const
IOutlineService
=
createDecorator
<
IOutlineService
>
(
'
IOutlineService
'
);
export
const
enum
OutlineTarget
{
OutlinePane
=
1
,
Breadcrumbs
=
2
,
QuickPick
=
4
}
export
interface
IOutlineService
{
_serviceBrand
:
undefined
;
onDidChange
:
Event
<
void
>
;
canCreateOutline
(
editor
:
IEditorPane
):
boolean
;
createOutline
(
editor
:
IEditorPane
,
token
:
CancellationToken
):
Promise
<
IOutline
<
any
>
|
undefined
>
;
createOutline
(
editor
:
IEditorPane
,
t
arget
:
OutlineTarget
,
t
oken
:
CancellationToken
):
Promise
<
IOutline
<
any
>
|
undefined
>
;
registerOutlineCreator
(
creator
:
IOutlineCreator
<
any
,
any
>
):
IDisposable
;
}
export
interface
IOutlineCreator
<
P
extends
IEditorPane
,
E
>
{
matches
(
candidate
:
IEditorPane
):
candidate
is
P
;
createOutline
(
editor
:
P
,
token
:
CancellationToken
):
Promise
<
IOutline
<
E
>
|
undefined
>
;
createOutline
(
editor
:
P
,
t
arget
:
OutlineTarget
,
t
oken
:
CancellationToken
):
Promise
<
IOutline
<
E
>
|
undefined
>
;
}
export
interface
IBreadcrumbsDataSource
<
E
>
{
...
...
@@ -39,23 +45,6 @@ export interface IOutlineComparator<E> {
compareByName
(
a
:
E
,
b
:
E
):
number
;
}
export
interface
IOutlineBreadcrumbsConfig
<
E
>
{
readonly
breadcrumbsDataSource
:
IBreadcrumbsDataSource
<
E
>
;
readonly
treeDataSource
:
IDataSource
<
IOutline
<
E
>
|
undefined
,
E
>
;
readonly
delegate
:
IListVirtualDelegate
<
E
>
;
readonly
renderers
:
ITreeRenderer
<
E
,
FuzzyScore
,
any
>
[];
readonly
comparator
:
IOutlineComparator
<
E
>
;
readonly
options
:
IWorkbenchDataTreeOptions
<
E
,
FuzzyScore
>
;
}
export
interface
IOutlineTreeConfig
<
E
>
{
readonly
treeDataSource
:
IDataSource
<
IOutline
<
E
>
|
undefined
,
E
>
;
readonly
delegate
:
IListVirtualDelegate
<
E
>
;
readonly
renderers
:
ITreeRenderer
<
E
,
FuzzyScore
,
any
>
[];
readonly
comparator
:
IOutlineComparator
<
E
>
;
readonly
options
:
IWorkbenchDataTreeOptions
<
E
,
FuzzyScore
>
;
}
export
interface
IQuickPickOutlineElement
<
E
>
{
readonly
element
:
E
;
readonly
label
:
string
;
...
...
@@ -68,8 +57,14 @@ export interface IQuickPickDataSource<E> {
getQuickPickElements
():
Iterable
<
IQuickPickOutlineElement
<
E
>>
;
}
export
interface
IOutlineQuickPickConfig
<
E
>
{
readonly
quickPickDataSource
:
IQuickPickDataSource
<
E
>
,
export
interface
IOutlineListConfig
<
E
>
{
readonly
breadcrumbsDataSource
:
IBreadcrumbsDataSource
<
E
>
;
readonly
treeDataSource
:
IDataSource
<
IOutline
<
E
>
|
undefined
,
E
>
;
readonly
delegate
:
IListVirtualDelegate
<
E
>
;
readonly
renderers
:
ITreeRenderer
<
E
,
FuzzyScore
,
any
>
[];
readonly
comparator
:
IOutlineComparator
<
E
>
;
readonly
options
:
IWorkbenchDataTreeOptions
<
E
,
FuzzyScore
>
;
readonly
quickPickDataSource
:
IQuickPickDataSource
<
E
>
;
}
export
interface
OutlineChangeEvent
{
...
...
@@ -78,9 +73,7 @@ export interface OutlineChangeEvent {
export
interface
IOutline
<
E
>
{
readonly
breadcrumbsConfig
:
IOutlineBreadcrumbsConfig
<
E
>
;
readonly
treeConfig
:
IOutlineTreeConfig
<
E
>
;
readonly
quickPickConfig
:
IOutlineQuickPickConfig
<
E
>
;
readonly
config
:
IOutlineListConfig
<
E
>
;
readonly
outlineKind
:
string
;
readonly
isEmpty
:
boolean
;
...
...
src/vs/workbench/services/outline/browser/outlineService.ts
浏览文件 @
475d3464
...
...
@@ -8,7 +8,7 @@ import { IDisposable, toDisposable } from 'vs/base/common/lifecycle';
import
{
LinkedList
}
from
'
vs/base/common/linkedList
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IEditorPane
}
from
'
vs/workbench/common/editor
'
;
import
{
IOutline
,
IOutlineCreator
,
IOutlineService
}
from
'
vs/workbench/services/outline/browser/outline
'
;
import
{
IOutline
,
IOutlineCreator
,
IOutlineService
,
OutlineTarget
}
from
'
vs/workbench/services/outline/browser/outline
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
class
OutlineService
implements
IOutlineService
{
...
...
@@ -29,10 +29,10 @@ class OutlineService implements IOutlineService {
return
false
;
}
async
createOutline
(
pane
:
IEditorPane
,
token
:
CancellationToken
):
Promise
<
IOutline
<
any
>
|
undefined
>
{
async
createOutline
(
pane
:
IEditorPane
,
t
arget
:
OutlineTarget
,
t
oken
:
CancellationToken
):
Promise
<
IOutline
<
any
>
|
undefined
>
{
for
(
let
factory
of
this
.
_factories
)
{
if
(
factory
.
matches
(
pane
))
{
return
await
factory
.
createOutline
(
pane
,
token
);
return
await
factory
.
createOutline
(
pane
,
t
arget
,
t
oken
);
}
}
return
undefined
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录