Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2a270de2
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,发现更多精彩内容 >>
提交
2a270de2
编写于
5月 14, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add extensionId to DocumentSymbolProvider interface
上级
7fda0363
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
13 addition
and
9 deletion
+13
-9
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+3
-0
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+1
-0
src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts
...kbench/api/electron-browser/mainThreadLanguageFeatures.ts
+2
-1
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+1
-1
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-1
src/vs/workbench/api/node/extHostLanguageFeatures.ts
src/vs/workbench/api/node/extHostLanguageFeatures.ts
+2
-2
src/vs/workbench/parts/outline/electron-browser/outlineModel.ts
.../workbench/parts/outline/electron-browser/outlineModel.ts
+3
-4
未找到文件。
src/vs/editor/common/modes.ts
浏览文件 @
2a270de2
...
...
@@ -676,6 +676,9 @@ export interface SymbolInformation {
* the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_goto-symbol)-feature.
*/
export
interface
DocumentSymbolProvider
{
extensionId
?:
string
;
/**
* Provide symbol information for the given document.
*/
...
...
src/vs/monaco.d.ts
浏览文件 @
2a270de2
...
...
@@ -4893,6 +4893,7 @@ declare namespace monaco.languages {
* the [go to symbol](https://code.visualstudio.com/docs/editor/editingevolved#_goto-symbol)-feature.
*/
export
interface
DocumentSymbolProvider
{
extensionId
?:
string
;
/**
* Provide symbol information for the given document.
*/
...
...
src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts
浏览文件 @
2a270de2
...
...
@@ -97,8 +97,9 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
// --- outline
$registerOutlineSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]):
void
{
$registerOutlineSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]
,
extensionId
:
string
):
void
{
this
.
_registrations
[
handle
]
=
modes
.
DocumentSymbolProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
DocumentSymbolProvider
>
{
extensionId
,
provideDocumentSymbols
:
(
model
:
ITextModel
,
token
:
CancellationToken
):
Thenable
<
modes
.
SymbolInformation
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideDocumentSymbols
(
handle
,
model
.
uri
)).
then
(
MainThreadLanguageFeatures
.
_reviveSymbolInformationDto
);
}
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
2a270de2
...
...
@@ -285,7 +285,7 @@ export function createApiFactory(
return
extHostLanguageFeatures
.
registerRenameProvider
(
checkSelector
(
selector
),
provider
);
},
registerDocumentSymbolProvider
(
selector
:
vscode
.
DocumentSelector
,
provider
:
vscode
.
DocumentSymbolProvider
):
vscode
.
Disposable
{
return
extHostLanguageFeatures
.
registerDocumentSymbolProvider
(
checkSelector
(
selector
),
provider
);
return
extHostLanguageFeatures
.
registerDocumentSymbolProvider
(
checkSelector
(
selector
),
provider
,
extension
.
id
);
},
registerWorkspaceSymbolProvider
(
provider
:
vscode
.
WorkspaceSymbolProvider
):
vscode
.
Disposable
{
return
extHostLanguageFeatures
.
registerWorkspaceSymbolProvider
(
provider
);
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
2a270de2
...
...
@@ -263,7 +263,7 @@ export interface ISerializedDocumentFilter {
export
interface
MainThreadLanguageFeaturesShape
extends
IDisposable
{
$unregister
(
handle
:
number
):
void
;
$registerOutlineSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]):
void
;
$registerOutlineSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]
,
extensionId
:
string
):
void
;
$registerCodeLensSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[],
eventHandle
:
number
):
void
;
$emitCodeLensEvent
(
eventHandle
:
number
,
event
?:
any
):
void
;
$registerDeclaractionSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]):
void
;
...
...
src/vs/workbench/api/node/extHostLanguageFeatures.ts
浏览文件 @
2a270de2
...
...
@@ -928,9 +928,9 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape {
// --- outline
registerDocumentSymbolProvider
(
selector
:
vscode
.
DocumentSelector
,
provider
:
vscode
.
DocumentSymbolProvider
):
vscode
.
Disposable
{
registerDocumentSymbolProvider
(
selector
:
vscode
.
DocumentSelector
,
provider
:
vscode
.
DocumentSymbolProvider
,
extensionId
?:
string
):
vscode
.
Disposable
{
const
handle
=
this
.
_addNewAdapter
(
new
OutlineAdapter
(
this
.
_documents
,
provider
));
this
.
_proxy
.
$registerOutlineSupport
(
handle
,
this
.
_transformDocumentSelector
(
selector
));
this
.
_proxy
.
$registerOutlineSupport
(
handle
,
this
.
_transformDocumentSelector
(
selector
)
,
extensionId
);
return
this
.
_createDisposable
(
handle
);
}
...
...
src/vs/workbench/parts/outline/electron-browser/outlineModel.ts
浏览文件 @
2a270de2
...
...
@@ -14,10 +14,9 @@ import { Range } from 'vs/editor/common/core/range';
import
{
values
}
from
'
vs/base/common/map
'
;
export
function
getOutline
(
model
:
ITextModel
):
TPromise
<
OutlineItemGroup
>
[]
{
return
DocumentSymbolProviderRegistry
.
ordered
(
model
).
map
((
provider
,
i
)
=>
{
let
source
=
`provider
${
i
}
`
;
return
DocumentSymbolProviderRegistry
.
ordered
(
model
).
map
(
provider
=>
{
return
asWinJsPromise
(
token
=>
provider
.
provideDocumentSymbols
(
model
,
token
)).
then
(
result
=>
{
let
group
=
new
OutlineItemGroup
(
source
);
let
group
=
new
OutlineItemGroup
(
provider
.
extensionId
);
for
(
const
info
of
result
)
{
let
child
=
asOutlineItem
(
info
,
group
);
group
.
children
.
set
(
child
.
id
,
child
);
...
...
@@ -25,7 +24,7 @@ export function getOutline(model: ITextModel): TPromise<OutlineItemGroup>[] {
return
group
;
},
err
=>
{
//todo@joh capture error in group
return
new
OutlineItemGroup
(
source
);
return
new
OutlineItemGroup
(
provider
.
extensionId
);
});
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录