Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
cbf8b411
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,发现更多精彩内容 >>
未验证
提交
cbf8b411
编写于
9月 13, 2021
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move TypeHierarchy-API to stable,
https://github.com/microsoft/vscode/issues/15533
上级
1344e7ea
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
110 addition
and
117 deletion
+110
-117
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+107
-0
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+0
-113
src/vs/workbench/api/common/extHost.api.impl.ts
src/vs/workbench/api/common/extHost.api.impl.ts
+3
-4
未找到文件。
src/vs/vscode.d.ts
浏览文件 @
cbf8b411
...
...
@@ -4767,6 +4767,104 @@ declare module 'vscode' {
provideCallHierarchyOutgoingCalls
(
item
:
CallHierarchyItem
,
token
:
CancellationToken
):
ProviderResult
<
CallHierarchyOutgoingCall
[]
>
;
}
/**
* Represents an item of a type hierarchy, like a class or an interface.
*/
export
class
TypeHierarchyItem
{
/**
* The name of this item.
*/
name
:
string
;
/**
* The kind of this item.
*/
kind
:
SymbolKind
;
/**
* Tags for this item.
*/
tags
?:
ReadonlyArray
<
SymbolTag
>
;
/**
* More detail for this item, e.g. the signature of a function.
*/
detail
?:
string
;
/**
* The resource identifier of this item.
*/
uri
:
Uri
;
/**
* The range enclosing this symbol not including leading/trailing whitespace
* but everything else, e.g. comments and code.
*/
range
:
Range
;
/**
* The range that should be selected and revealed when this symbol is being
* picked, e.g. the name of a class. Must be contained by the {@link TypeHierarchyItem.range range}-property.
*/
selectionRange
:
Range
;
/**
* Creates a new type hierarchy item.
*
* @param kind The kind of the item.
* @param name The name of the item.
* @param detail The details of the item.
* @param uri The Uri of the item.
* @param range The whole range of the item.
* @param selectionRange The selection range of the item.
*/
constructor
(
kind
:
SymbolKind
,
name
:
string
,
detail
:
string
,
uri
:
Uri
,
range
:
Range
,
selectionRange
:
Range
);
}
/**
* The type hierarchy provider interface describes the contract between extensions
* and the type hierarchy feature.
*/
export
interface
TypeHierarchyProvider
{
/**
* Bootstraps type hierarchy by returning the item that is denoted by the given document
* and position. This item will be used as entry into the type graph. Providers should
* return `undefined` or `null` when there is no item at the given location.
*
* @param document The document in which the command was invoked.
* @param position The position at which the command was invoked.
* @param token A cancellation token.
* @returns One or multiple type hierarchy items or a thenable that resolves to such. The lack of a result can be
* signaled by returning `undefined`, `null`, or an empty array.
*/
prepareTypeHierarchy
(
document
:
TextDocument
,
position
:
Position
,
token
:
CancellationToken
):
ProviderResult
<
TypeHierarchyItem
|
TypeHierarchyItem
[]
>
;
/**
* Provide all supertypes for an item, e.g all types from which a type is derived/inherited. In graph terms this describes directed
* and annotated edges inside the type graph, e.g the given item is the starting node and the result is the nodes
* that can be reached.
*
* @param item The hierarchy item for which super types should be computed.
* @param token A cancellation token.
* @returns A set of direct supertypes or a thenable that resolves to such. The lack of a result can be
* signaled by returning `undefined` or `null`.
*/
provideTypeHierarchySupertypes
(
item
:
TypeHierarchyItem
,
token
:
CancellationToken
):
ProviderResult
<
TypeHierarchyItem
[]
>
;
/**
* Provide all subtypes for an item, e.g all types which are derived/inherited from the given item. In
* graph terms this describes directed and annotated edges inside the type graph, e.g the given item is the starting
* node and the result is the nodes that can be reached.
*
* @param item The hierarchy item for which subtypes should be computed.
* @param token A cancellation token.
* @returns A set of direct subtypes or a thenable that resolves to such. The lack of a result can be
* signaled by returning `undefined` or `null`.
*/
provideTypeHierarchySubtypes
(
item
:
TypeHierarchyItem
,
token
:
CancellationToken
):
ProviderResult
<
TypeHierarchyItem
[]
>
;
}
/**
* Represents a list of ranges that can be edited together along with a word pattern to describe valid range contents.
*/
...
...
@@ -11520,6 +11618,15 @@ declare module 'vscode' {
*/
export
function
registerCallHierarchyProvider
(
selector
:
DocumentSelector
,
provider
:
CallHierarchyProvider
):
Disposable
;
/**
* Register a type hierarchy provider.
*
* @param selector A selector that defines the documents this provider is applicable to.
* @param provider A type hierarchy provider.
* @return {@link Disposable Disposable} that unregisters this provider when being disposed.
*/
export
function
registerTypeHierarchyProvider
(
selector
:
DocumentSelector
,
provider
:
TypeHierarchyProvider
):
Disposable
;
/**
* Register a linked editing range provider.
*
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
cbf8b411
...
...
@@ -2816,119 +2816,6 @@ declare module 'vscode' {
//#endregion
//#region https://github.com/microsoft/vscode/issues/15533 --- Type hierarchy --- @eskibear
/**
* Represents an item of a type hierarchy, like a class or an interface.
*/
export
class
TypeHierarchyItem
{
/**
* The name of this item.
*/
name
:
string
;
/**
* The kind of this item.
*/
kind
:
SymbolKind
;
/**
* Tags for this item.
*/
tags
?:
ReadonlyArray
<
SymbolTag
>
;
/**
* More detail for this item, e.g. the signature of a function.
*/
detail
?:
string
;
/**
* The resource identifier of this item.
*/
uri
:
Uri
;
/**
* The range enclosing this symbol not including leading/trailing whitespace
* but everything else, e.g. comments and code.
*/
range
:
Range
;
/**
* The range that should be selected and revealed when this symbol is being
* picked, e.g. the name of a class. Must be contained by the {@link TypeHierarchyItem.range range}-property.
*/
selectionRange
:
Range
;
/**
* Creates a new type hierarchy item.
*
* @param kind The kind of the item.
* @param name The name of the item.
* @param detail The details of the item.
* @param uri The Uri of the item.
* @param range The whole range of the item.
* @param selectionRange The selection range of the item.
*/
constructor
(
kind
:
SymbolKind
,
name
:
string
,
detail
:
string
,
uri
:
Uri
,
range
:
Range
,
selectionRange
:
Range
);
}
/**
* The type hierarchy provider interface describes the contract between extensions
* and the type hierarchy feature.
*/
export
interface
TypeHierarchyProvider
{
/**
* Bootstraps type hierarchy by returning the item that is denoted by the given document
* and position. This item will be used as entry into the type graph. Providers should
* return `undefined` or `null` when there is no item at the given location.
*
* @param document The document in which the command was invoked.
* @param position The position at which the command was invoked.
* @param token A cancellation token.
* @returns One or multiple type hierarchy items or a thenable that resolves to such. The lack of a result can be
* signaled by returning `undefined`, `null`, or an empty array.
*/
prepareTypeHierarchy
(
document
:
TextDocument
,
position
:
Position
,
token
:
CancellationToken
):
ProviderResult
<
TypeHierarchyItem
|
TypeHierarchyItem
[]
>
;
/**
* Provide all supertypes for an item, e.g all types from which a type is derived/inherited. In graph terms this describes directed
* and annotated edges inside the type graph, e.g the given item is the starting node and the result is the nodes
* that can be reached.
*
* @param item The hierarchy item for which super types should be computed.
* @param token A cancellation token.
* @returns A set of supertypes or a thenable that resolves to such. The lack of a result can be
* signaled by returning `undefined` or `null`.
*/
provideTypeHierarchySupertypes
(
item
:
TypeHierarchyItem
,
token
:
CancellationToken
):
ProviderResult
<
TypeHierarchyItem
[]
>
;
/**
* Provide all subtypes for an item, e.g all types which are derived/inherited from the given item. In
* graph terms this describes directed and annotated edges inside the type graph, e.g the given item is the starting
* node and the result is the nodes that can be reached.
*
* @param item The hierarchy item for which subtypes should be computed.
* @param token A cancellation token.
* @returns A set of subtypes or a thenable that resolves to such. The lack of a result can be
* signaled by returning `undefined` or `null`.
*/
provideTypeHierarchySubtypes
(
item
:
TypeHierarchyItem
,
token
:
CancellationToken
):
ProviderResult
<
TypeHierarchyItem
[]
>
;
}
export
namespace
languages
{
/**
* Register a type hierarchy provider.
*
* @param selector A selector that defines the documents this provider is applicable to.
* @param provider A type hierarchy provider.
* @return {@link Disposable Disposable} that unregisters this provider when being disposed.
*/
export
function
registerTypeHierarchyProvider
(
selector
:
DocumentSelector
,
provider
:
TypeHierarchyProvider
):
Disposable
;
}
//#endregion
//#region https://github.com/microsoft/vscode/issues/129037
enum
LanguageStatusSeverity
{
...
...
src/vs/workbench/api/common/extHost.api.impl.ts
浏览文件 @
cbf8b411
...
...
@@ -495,6 +495,9 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
registerCallHierarchyProvider
(
selector
:
vscode
.
DocumentSelector
,
provider
:
vscode
.
CallHierarchyProvider
):
vscode
.
Disposable
{
return
extHostLanguageFeatures
.
registerCallHierarchyProvider
(
extension
,
selector
,
provider
);
},
registerTypeHierarchyProvider
(
selector
:
vscode
.
DocumentSelector
,
provider
:
vscode
.
TypeHierarchyProvider
):
vscode
.
Disposable
{
return
extHostLanguageFeatures
.
registerTypeHierarchyProvider
(
extension
,
selector
,
provider
);
},
setLanguageConfiguration
:
(
language
:
string
,
configuration
:
vscode
.
LanguageConfiguration
):
vscode
.
Disposable
=>
{
return
extHostLanguageFeatures
.
setLanguageConfiguration
(
extension
,
language
,
configuration
);
},
...
...
@@ -506,10 +509,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
checkProposedApiEnabled
(
extension
);
return
extHostLanguageFeatures
.
registerInlayHintsProvider
(
extension
,
selector
,
provider
);
},
registerTypeHierarchyProvider
(
selector
:
vscode
.
DocumentSelector
,
provider
:
vscode
.
TypeHierarchyProvider
):
vscode
.
Disposable
{
checkProposedApiEnabled
(
extension
);
return
extHostLanguageFeatures
.
registerTypeHierarchyProvider
(
extension
,
selector
,
provider
);
},
createLanguageStatusItem
(
id
:
string
,
selector
:
vscode
.
DocumentSelector
):
vscode
.
LanguageStatusItem
{
checkProposedApiEnabled
(
extension
);
return
extHostLanguages
.
createLanguageStatusItem
(
extension
,
id
,
selector
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录