Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
efd8f4a4
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,发现更多精彩内容 >>
提交
efd8f4a4
编写于
9月 04, 2018
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adopt CancellationToken in ExtHostLanguageFeaturesShape
上级
fa5922bd
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
164 addition
and
171 deletion
+164
-171
src/vs/base/common/async.ts
src/vs/base/common/async.ts
+11
-5
src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts
...kbench/api/electron-browser/mainThreadLanguageFeatures.ts
+25
-28
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+24
-24
src/vs/workbench/api/node/extHostLanguageFeatures.ts
src/vs/workbench/api/node/extHostLanguageFeatures.ts
+104
-114
未找到文件。
src/vs/base/common/async.ts
浏览文件 @
efd8f4a4
...
...
@@ -87,11 +87,17 @@ export function asWinJsPromise<T>(callback: (token: CancellationToken) => T | TP
});
}
export
function
asThenable
<
T
>
(
item
:
T
|
TPromise
<
T
>
|
Thenable
<
T
>
):
Thenable
<
T
>
{
if
(
item
instanceof
TPromise
||
isThenable
<
T
>
(
item
))
{
return
item
;
}
return
TPromise
.
wrap
(
item
);
export
function
asThenable
<
T
>
(
callback
:
()
=>
T
|
TPromise
<
T
>
|
Thenable
<
T
>
):
Thenable
<
T
>
{
return
new
TPromise
<
T
>
((
resolve
,
reject
)
=>
{
let
item
=
callback
();
if
(
item
instanceof
TPromise
)
{
item
.
then
(
resolve
,
reject
);
}
else
if
(
isThenable
<
T
>
(
item
))
{
item
.
then
(
resolve
,
reject
);
}
else
{
resolve
(
item
);
}
},
()
=>
{
/* not supported */
});
}
/**
...
...
src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts
浏览文件 @
efd8f4a4
...
...
@@ -9,7 +9,6 @@ import { Emitter } from 'vs/base/common/event';
import
{
ITextModel
,
ISingleEditOperation
}
from
'
vs/editor/common/model
'
;
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
*
as
search
from
'
vs/workbench/parts/search/common/search
'
;
import
{
wireCancellationToken
}
from
'
vs/base/common/async
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
import
{
Position
as
EditorPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
Range
as
EditorRange
}
from
'
vs/editor/common/core/range
'
;
...
...
@@ -114,7 +113,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
this
.
_registrations
[
handle
]
=
modes
.
DocumentSymbolProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
DocumentSymbolProvider
>
{
displayName
,
provideDocumentSymbols
:
(
model
:
ITextModel
,
token
:
CancellationToken
):
Thenable
<
modes
.
DocumentSymbol
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideDocumentSymbols
(
handle
,
model
.
uri
)
);
return
this
.
_proxy
.
$provideDocumentSymbols
(
handle
,
model
.
uri
,
token
);
}
});
}
...
...
@@ -125,10 +124,10 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
const
provider
=
<
modes
.
CodeLensProvider
>
{
provideCodeLenses
:
(
model
:
ITextModel
,
token
:
CancellationToken
):
modes
.
ICodeLensSymbol
[]
|
Thenable
<
modes
.
ICodeLensSymbol
[]
>
=>
{
return
this
.
_heapService
.
trackRecursive
(
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideCodeLenses
(
handle
,
model
.
uri
)
));
return
this
.
_heapService
.
trackRecursive
(
this
.
_proxy
.
$provideCodeLenses
(
handle
,
model
.
uri
,
token
));
},
resolveCodeLens
:
(
model
:
ITextModel
,
codeLens
:
modes
.
ICodeLensSymbol
,
token
:
CancellationToken
):
modes
.
ICodeLensSymbol
|
Thenable
<
modes
.
ICodeLensSymbol
>
=>
{
return
this
.
_heapService
.
trackRecursive
(
wireCancellationToken
(
token
,
this
.
_proxy
.
$resolveCodeLens
(
handle
,
model
.
uri
,
codeLens
)
));
return
this
.
_heapService
.
trackRecursive
(
this
.
_proxy
.
$resolveCodeLens
(
handle
,
model
.
uri
,
codeLens
,
token
));
}
};
...
...
@@ -153,7 +152,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
$registerDeclaractionSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]):
void
{
this
.
_registrations
[
handle
]
=
modes
.
DefinitionProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
DefinitionProvider
>
{
provideDefinition
:
(
model
,
position
,
token
):
Thenable
<
modes
.
DefinitionLink
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideDefinition
(
handle
,
model
.
uri
,
position
)
).
then
(
MainThreadLanguageFeatures
.
_reviveDefinitionLinkDto
);
return
this
.
_proxy
.
$provideDefinition
(
handle
,
model
.
uri
,
position
,
token
).
then
(
MainThreadLanguageFeatures
.
_reviveDefinitionLinkDto
);
}
});
}
...
...
@@ -161,7 +160,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
$registerImplementationSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]):
void
{
this
.
_registrations
[
handle
]
=
modes
.
ImplementationProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
ImplementationProvider
>
{
provideImplementation
:
(
model
,
position
,
token
):
Thenable
<
modes
.
Definition
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideImplementation
(
handle
,
model
.
uri
,
position
)
).
then
(
MainThreadLanguageFeatures
.
_reviveDefinitionLinkDto
);
return
this
.
_proxy
.
$provideImplementation
(
handle
,
model
.
uri
,
position
,
token
).
then
(
MainThreadLanguageFeatures
.
_reviveDefinitionLinkDto
);
}
});
}
...
...
@@ -169,7 +168,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
$registerTypeDefinitionSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]):
void
{
this
.
_registrations
[
handle
]
=
modes
.
TypeDefinitionProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
TypeDefinitionProvider
>
{
provideTypeDefinition
:
(
model
,
position
,
token
):
Thenable
<
modes
.
Definition
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideTypeDefinition
(
handle
,
model
.
uri
,
position
)
).
then
(
MainThreadLanguageFeatures
.
_reviveDefinitionLinkDto
);
return
this
.
_proxy
.
$provideTypeDefinition
(
handle
,
model
.
uri
,
position
,
token
).
then
(
MainThreadLanguageFeatures
.
_reviveDefinitionLinkDto
);
}
});
}
...
...
@@ -189,7 +188,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
$registerDocumentHighlightProvider
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]):
void
{
this
.
_registrations
[
handle
]
=
modes
.
DocumentHighlightProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
DocumentHighlightProvider
>
{
provideDocumentHighlights
:
(
model
:
ITextModel
,
position
:
EditorPosition
,
token
:
CancellationToken
):
Thenable
<
modes
.
DocumentHighlight
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideDocumentHighlights
(
handle
,
model
.
uri
,
position
)
);
return
this
.
_proxy
.
$provideDocumentHighlights
(
handle
,
model
.
uri
,
position
,
token
);
}
});
}
...
...
@@ -199,7 +198,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
$registerReferenceSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]):
void
{
this
.
_registrations
[
handle
]
=
modes
.
ReferenceProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
ReferenceProvider
>
{
provideReferences
:
(
model
:
ITextModel
,
position
:
EditorPosition
,
context
:
modes
.
ReferenceContext
,
token
:
CancellationToken
):
Thenable
<
modes
.
Location
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideReferences
(
handle
,
model
.
uri
,
position
,
context
)
).
then
(
MainThreadLanguageFeatures
.
_reviveLocationDto
);
return
this
.
_proxy
.
$provideReferences
(
handle
,
model
.
uri
,
position
,
context
,
token
).
then
(
MainThreadLanguageFeatures
.
_reviveLocationDto
);
}
});
}
...
...
@@ -209,7 +208,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
$registerQuickFixSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[],
providedCodeActionKinds
?:
string
[]):
void
{
this
.
_registrations
[
handle
]
=
modes
.
CodeActionProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
CodeActionProvider
>
{
provideCodeActions
:
(
model
:
ITextModel
,
rangeOrSelection
:
EditorRange
|
Selection
,
context
:
modes
.
CodeActionContext
,
token
:
CancellationToken
):
Thenable
<
modes
.
CodeAction
[]
>
=>
{
return
this
.
_heapService
.
trackRecursive
(
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideCodeActions
(
handle
,
model
.
uri
,
rangeOrSelection
,
context
)
)).
then
(
MainThreadLanguageFeatures
.
_reviveCodeActionDto
);
return
this
.
_heapService
.
trackRecursive
(
this
.
_proxy
.
$provideCodeActions
(
handle
,
model
.
uri
,
rangeOrSelection
,
context
,
token
)).
then
(
MainThreadLanguageFeatures
.
_reviveCodeActionDto
);
},
providedCodeActionKinds
});
...
...
@@ -220,7 +219,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
$registerDocumentFormattingSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]):
void
{
this
.
_registrations
[
handle
]
=
modes
.
DocumentFormattingEditProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
DocumentFormattingEditProvider
>
{
provideDocumentFormattingEdits
:
(
model
:
ITextModel
,
options
:
modes
.
FormattingOptions
,
token
:
CancellationToken
):
Thenable
<
ISingleEditOperation
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideDocumentFormattingEdits
(
handle
,
model
.
uri
,
options
)
);
return
this
.
_proxy
.
$provideDocumentFormattingEdits
(
handle
,
model
.
uri
,
options
,
token
);
}
});
}
...
...
@@ -228,7 +227,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
$registerRangeFormattingSupport
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]):
void
{
this
.
_registrations
[
handle
]
=
modes
.
DocumentRangeFormattingEditProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
DocumentRangeFormattingEditProvider
>
{
provideDocumentRangeFormattingEdits
:
(
model
:
ITextModel
,
range
:
EditorRange
,
options
:
modes
.
FormattingOptions
,
token
:
CancellationToken
):
Thenable
<
ISingleEditOperation
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideDocumentRangeFormattingEdits
(
handle
,
model
.
uri
,
range
,
options
)
);
return
this
.
_proxy
.
$provideDocumentRangeFormattingEdits
(
handle
,
model
.
uri
,
range
,
options
,
token
);
}
});
}
...
...
@@ -239,7 +238,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
autoFormatTriggerCharacters
,
provideOnTypeFormattingEdits
:
(
model
:
ITextModel
,
position
:
EditorPosition
,
ch
:
string
,
options
:
modes
.
FormattingOptions
,
token
:
CancellationToken
):
Thenable
<
ISingleEditOperation
[]
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideOnTypeFormattingEdits
(
handle
,
model
.
uri
,
position
,
ch
,
options
)
);
return
this
.
_proxy
.
$provideOnTypeFormattingEdits
(
handle
,
model
.
uri
,
position
,
ch
,
options
,
token
);
}
});
}
...
...
@@ -250,18 +249,16 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
let
lastResultId
:
number
;
this
.
_registrations
[
handle
]
=
search
.
WorkspaceSymbolProviderRegistry
.
register
(
<
search
.
IWorkspaceSymbolProvider
>
{
provideWorkspaceSymbols
:
(
search
:
string
,
token
:
CancellationToken
):
Thenable
<
search
.
IWorkspaceSymbol
[]
>
=>
{
let
promise
=
this
.
_proxy
.
$provideWorkspaceSymbols
(
handle
,
search
).
then
(
result
=>
{
return
this
.
_proxy
.
$provideWorkspaceSymbols
(
handle
,
search
,
token
).
then
(
result
=>
{
if
(
lastResultId
!==
undefined
)
{
this
.
_proxy
.
$releaseWorkspaceSymbols
(
handle
,
lastResultId
);
}
lastResultId
=
result
.
_id
;
return
MainThreadLanguageFeatures
.
_reviveWorkspaceSymbolDto
(
result
.
symbols
);
});
return
wireCancellationToken
(
token
,
promise
);
},
resolveWorkspaceSymbol
:
(
item
:
search
.
IWorkspaceSymbol
,
token
:
CancellationToken
):
Thenable
<
search
.
IWorkspaceSymbol
>
=>
{
let
promise
=
this
.
_proxy
.
$resolveWorkspaceSymbol
(
handle
,
item
).
then
(
i
=>
MainThreadLanguageFeatures
.
_reviveWorkspaceSymbolDto
(
i
));
return
wireCancellationToken
(
token
,
promise
);
return
this
.
_proxy
.
$resolveWorkspaceSymbol
(
handle
,
item
,
token
).
then
(
i
=>
MainThreadLanguageFeatures
.
_reviveWorkspaceSymbolDto
(
i
));
}
});
}
...
...
@@ -272,10 +269,10 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
this
.
_registrations
[
handle
]
=
modes
.
RenameProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
RenameProvider
>
{
provideRenameEdits
:
(
model
:
ITextModel
,
position
:
EditorPosition
,
newName
:
string
,
token
:
CancellationToken
):
Thenable
<
modes
.
WorkspaceEdit
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideRenameEdits
(
handle
,
model
.
uri
,
position
,
newName
)
).
then
(
reviveWorkspaceEditDto
);
return
this
.
_proxy
.
$provideRenameEdits
(
handle
,
model
.
uri
,
position
,
newName
,
token
).
then
(
reviveWorkspaceEditDto
);
},
resolveRenameLocation
:
supportResolveLocation
?
(
model
:
ITextModel
,
position
:
EditorPosition
,
token
:
CancellationToken
):
Thenable
<
modes
.
RenameLocation
>
=>
wireCancellationToken
(
token
,
this
.
_proxy
.
$resolveRenameLocation
(
handle
,
model
.
uri
,
position
)
)
?
(
model
:
ITextModel
,
position
:
EditorPosition
,
token
:
CancellationToken
):
Thenable
<
modes
.
RenameLocation
>
=>
this
.
_proxy
.
$resolveRenameLocation
(
handle
,
model
.
uri
,
position
,
token
)
:
undefined
});
}
...
...
@@ -286,7 +283,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
this
.
_registrations
[
handle
]
=
modes
.
SuggestRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
ISuggestSupport
>
{
triggerCharacters
,
provideCompletionItems
:
(
model
:
ITextModel
,
position
:
EditorPosition
,
context
:
modes
.
SuggestContext
,
token
:
CancellationToken
):
Thenable
<
modes
.
ISuggestResult
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideCompletionItems
(
handle
,
model
.
uri
,
position
,
context
)
).
then
(
result
=>
{
return
this
.
_proxy
.
$provideCompletionItems
(
handle
,
model
.
uri
,
position
,
context
,
token
).
then
(
result
=>
{
if
(
!
result
)
{
return
result
;
}
...
...
@@ -298,7 +295,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
});
},
resolveCompletionItem
:
supportsResolveDetails
?
(
model
,
position
,
suggestion
,
token
)
=>
wireCancellationToken
(
token
,
this
.
_proxy
.
$resolveCompletionItem
(
handle
,
model
.
uri
,
position
,
suggestion
)
)
?
(
model
,
position
,
suggestion
,
token
)
=>
this
.
_proxy
.
$resolveCompletionItem
(
handle
,
model
.
uri
,
position
,
suggestion
,
token
)
:
undefined
});
}
...
...
@@ -311,7 +308,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
signatureHelpTriggerCharacters
:
triggerCharacter
,
provideSignatureHelp
:
(
model
:
ITextModel
,
position
:
EditorPosition
,
token
:
CancellationToken
):
Thenable
<
modes
.
SignatureHelp
>
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideSignatureHelp
(
handle
,
model
.
uri
,
position
)
);
return
this
.
_proxy
.
$provideSignatureHelp
(
handle
,
model
.
uri
,
position
,
token
);
}
});
...
...
@@ -322,10 +319,10 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
$registerDocumentLinkProvider
(
handle
:
number
,
selector
:
ISerializedDocumentFilter
[]):
void
{
this
.
_registrations
[
handle
]
=
modes
.
LinkProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
LinkProvider
>
{
provideLinks
:
(
model
,
token
)
=>
{
return
this
.
_heapService
.
trackRecursive
(
wireCancellationToken
(
token
,
this
.
_proxy
.
$provideDocumentLinks
(
handle
,
model
.
uri
)
));
return
this
.
_heapService
.
trackRecursive
(
this
.
_proxy
.
$provideDocumentLinks
(
handle
,
model
.
uri
,
token
));
},
resolveLink
:
(
link
,
token
)
=>
{
return
wireCancellationToken
(
token
,
this
.
_proxy
.
$resolveDocumentLink
(
handle
,
link
)
);
return
this
.
_proxy
.
$resolveDocumentLink
(
handle
,
link
,
token
);
}
});
}
...
...
@@ -336,7 +333,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
const
proxy
=
this
.
_proxy
;
this
.
_registrations
[
handle
]
=
modes
.
ColorProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
DocumentColorProvider
>
{
provideDocumentColors
:
(
model
,
token
)
=>
{
return
wireCancellationToken
(
token
,
proxy
.
$provideDocumentColors
(
handle
,
model
.
uri
)
)
return
proxy
.
$provideDocumentColors
(
handle
,
model
.
uri
,
token
)
.
then
(
documentColors
=>
{
return
documentColors
.
map
(
documentColor
=>
{
const
[
red
,
green
,
blue
,
alpha
]
=
documentColor
.
color
;
...
...
@@ -356,10 +353,10 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
},
provideColorPresentations
:
(
model
,
colorInfo
,
token
)
=>
{
return
wireCancellationToken
(
token
,
proxy
.
$provideColorPresentations
(
handle
,
model
.
uri
,
{
return
proxy
.
$provideColorPresentations
(
handle
,
model
.
uri
,
{
color
:
[
colorInfo
.
color
.
red
,
colorInfo
.
color
.
green
,
colorInfo
.
color
.
blue
,
colorInfo
.
color
.
alpha
],
range
:
colorInfo
.
range
}
)
);
}
,
token
);
}
});
}
...
...
@@ -370,7 +367,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha
const
proxy
=
this
.
_proxy
;
this
.
_registrations
[
handle
]
=
modes
.
FoldingRangeProviderRegistry
.
register
(
typeConverters
.
LanguageSelector
.
from
(
selector
),
<
modes
.
FoldingRangeProvider
>
{
provideFoldingRanges
:
(
model
,
context
,
token
)
=>
{
return
wireCancellationToken
(
token
,
proxy
.
$provideFoldingRanges
(
handle
,
model
.
uri
,
context
)
);
return
proxy
.
$provideFoldingRanges
(
handle
,
model
.
uri
,
context
,
token
);
}
});
}
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
efd8f4a4
...
...
@@ -825,33 +825,33 @@ export interface CodeActionDto {
}
export
interface
ExtHostLanguageFeaturesShape
{
$provideDocumentSymbols
(
handle
:
number
,
resource
:
UriComponents
):
TPromis
e
<
modes
.
DocumentSymbol
[]
>
;
$provideCodeLenses
(
handle
:
number
,
resource
:
UriComponents
):
TPromis
e
<
modes
.
ICodeLensSymbol
[]
>
;
$resolveCodeLens
(
handle
:
number
,
resource
:
UriComponents
,
symbol
:
modes
.
ICodeLensSymbol
):
TPromis
e
<
modes
.
ICodeLensSymbol
>
;
$provideDefinition
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
):
TPromis
e
<
DefinitionLinkDto
[]
>
;
$provideImplementation
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
):
TPromis
e
<
DefinitionLinkDto
[]
>
;
$provideTypeDefinition
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
):
TPromis
e
<
DefinitionLinkDto
[]
>
;
$provideDocumentSymbols
(
handle
:
number
,
resource
:
UriComponents
,
token
:
CancellationToken
):
Thenabl
e
<
modes
.
DocumentSymbol
[]
>
;
$provideCodeLenses
(
handle
:
number
,
resource
:
UriComponents
,
token
:
CancellationToken
):
Thenabl
e
<
modes
.
ICodeLensSymbol
[]
>
;
$resolveCodeLens
(
handle
:
number
,
resource
:
UriComponents
,
symbol
:
modes
.
ICodeLensSymbol
,
token
:
CancellationToken
):
Thenabl
e
<
modes
.
ICodeLensSymbol
>
;
$provideDefinition
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
token
:
CancellationToken
):
Thenabl
e
<
DefinitionLinkDto
[]
>
;
$provideImplementation
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
token
:
CancellationToken
):
Thenabl
e
<
DefinitionLinkDto
[]
>
;
$provideTypeDefinition
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
token
:
CancellationToken
):
Thenabl
e
<
DefinitionLinkDto
[]
>
;
$provideHover
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
token
:
CancellationToken
):
Thenable
<
modes
.
Hover
>
;
$provideDocumentHighlights
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
):
TPromis
e
<
modes
.
DocumentHighlight
[]
>
;
$provideReferences
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
context
:
modes
.
ReferenceContext
):
TPromis
e
<
LocationDto
[]
>
;
$provideCodeActions
(
handle
:
number
,
resource
:
UriComponents
,
rangeOrSelection
:
IRange
|
ISelection
,
context
:
modes
.
CodeActionContext
):
TPromis
e
<
CodeActionDto
[]
>
;
$provideDocumentFormattingEdits
(
handle
:
number
,
resource
:
UriComponents
,
options
:
modes
.
FormattingOptions
):
TPromis
e
<
ISingleEditOperation
[]
>
;
$provideDocumentRangeFormattingEdits
(
handle
:
number
,
resource
:
UriComponents
,
range
:
IRange
,
options
:
modes
.
FormattingOptions
):
TPromis
e
<
ISingleEditOperation
[]
>
;
$provideOnTypeFormattingEdits
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
ch
:
string
,
options
:
modes
.
FormattingOptions
):
TPromis
e
<
ISingleEditOperation
[]
>
;
$provideWorkspaceSymbols
(
handle
:
number
,
search
:
string
):
TPromis
e
<
WorkspaceSymbolsDto
>
;
$resolveWorkspaceSymbol
(
handle
:
number
,
symbol
:
WorkspaceSymbolDto
):
TPromis
e
<
WorkspaceSymbolDto
>
;
$provideDocumentHighlights
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
token
:
CancellationToken
):
Thenabl
e
<
modes
.
DocumentHighlight
[]
>
;
$provideReferences
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
context
:
modes
.
ReferenceContext
,
token
:
CancellationToken
):
Thenabl
e
<
LocationDto
[]
>
;
$provideCodeActions
(
handle
:
number
,
resource
:
UriComponents
,
rangeOrSelection
:
IRange
|
ISelection
,
context
:
modes
.
CodeActionContext
,
token
:
CancellationToken
):
Thenabl
e
<
CodeActionDto
[]
>
;
$provideDocumentFormattingEdits
(
handle
:
number
,
resource
:
UriComponents
,
options
:
modes
.
FormattingOptions
,
token
:
CancellationToken
):
Thenabl
e
<
ISingleEditOperation
[]
>
;
$provideDocumentRangeFormattingEdits
(
handle
:
number
,
resource
:
UriComponents
,
range
:
IRange
,
options
:
modes
.
FormattingOptions
,
token
:
CancellationToken
):
Thenabl
e
<
ISingleEditOperation
[]
>
;
$provideOnTypeFormattingEdits
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
ch
:
string
,
options
:
modes
.
FormattingOptions
,
token
:
CancellationToken
):
Thenabl
e
<
ISingleEditOperation
[]
>
;
$provideWorkspaceSymbols
(
handle
:
number
,
search
:
string
,
token
:
CancellationToken
):
Thenabl
e
<
WorkspaceSymbolsDto
>
;
$resolveWorkspaceSymbol
(
handle
:
number
,
symbol
:
WorkspaceSymbolDto
,
token
:
CancellationToken
):
Thenabl
e
<
WorkspaceSymbolDto
>
;
$releaseWorkspaceSymbols
(
handle
:
number
,
id
:
number
):
void
;
$provideRenameEdits
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
newName
:
string
):
TPromis
e
<
WorkspaceEditDto
>
;
$resolveRenameLocation
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
):
TPromis
e
<
modes
.
RenameLocation
>
;
$provideCompletionItems
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
context
:
modes
.
SuggestContext
):
TPromis
e
<
SuggestResultDto
>
;
$resolveCompletionItem
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
suggestion
:
modes
.
ISuggestion
):
TPromis
e
<
modes
.
ISuggestion
>
;
$provideRenameEdits
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
newName
:
string
,
token
:
CancellationToken
):
Thenabl
e
<
WorkspaceEditDto
>
;
$resolveRenameLocation
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
token
:
CancellationToken
):
Thenabl
e
<
modes
.
RenameLocation
>
;
$provideCompletionItems
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
context
:
modes
.
SuggestContext
,
token
:
CancellationToken
):
Thenabl
e
<
SuggestResultDto
>
;
$resolveCompletionItem
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
suggestion
:
modes
.
ISuggestion
,
token
:
CancellationToken
):
Thenabl
e
<
modes
.
ISuggestion
>
;
$releaseCompletionItems
(
handle
:
number
,
id
:
number
):
void
;
$provideSignatureHelp
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
):
TPromis
e
<
modes
.
SignatureHelp
>
;
$provideDocumentLinks
(
handle
:
number
,
resource
:
UriComponents
):
TPromis
e
<
modes
.
ILink
[]
>
;
$resolveDocumentLink
(
handle
:
number
,
link
:
modes
.
ILink
):
TPromis
e
<
modes
.
ILink
>
;
$provideDocumentColors
(
handle
:
number
,
resource
:
UriComponents
):
TPromis
e
<
IRawColorInfo
[]
>
;
$provideColorPresentations
(
handle
:
number
,
resource
:
UriComponents
,
colorInfo
:
IRawColorInfo
):
TPromis
e
<
modes
.
IColorPresentation
[]
>
;
$provideFoldingRanges
(
handle
:
number
,
resource
:
UriComponents
,
context
:
modes
.
FoldingContext
):
TPromis
e
<
modes
.
FoldingRange
[]
>
;
$provideSignatureHelp
(
handle
:
number
,
resource
:
UriComponents
,
position
:
IPosition
,
token
:
CancellationToken
):
Thenabl
e
<
modes
.
SignatureHelp
>
;
$provideDocumentLinks
(
handle
:
number
,
resource
:
UriComponents
,
token
:
CancellationToken
):
Thenabl
e
<
modes
.
ILink
[]
>
;
$resolveDocumentLink
(
handle
:
number
,
link
:
modes
.
ILink
,
token
:
CancellationToken
):
Thenabl
e
<
modes
.
ILink
>
;
$provideDocumentColors
(
handle
:
number
,
resource
:
UriComponents
,
token
:
CancellationToken
):
Thenabl
e
<
IRawColorInfo
[]
>
;
$provideColorPresentations
(
handle
:
number
,
resource
:
UriComponents
,
colorInfo
:
IRawColorInfo
,
token
:
CancellationToken
):
Thenabl
e
<
modes
.
IColorPresentation
[]
>
;
$provideFoldingRanges
(
handle
:
number
,
resource
:
UriComponents
,
context
:
modes
.
FoldingContext
,
token
:
CancellationToken
):
Thenabl
e
<
modes
.
FoldingRange
[]
>
;
}
export
interface
ExtHostQuickOpenShape
{
...
...
src/vs/workbench/api/node/extHostLanguageFeatures.ts
浏览文件 @
efd8f4a4
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录