Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
0f1c9696
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,发现更多精彩内容 >>
提交
0f1c9696
编写于
8月 25, 2017
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Lazy load some ts providers
上级
f8f218b4
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
20 addition
and
35 deletion
+20
-35
extensions/typescript/src/features/directiveCommentCompletionProvider.ts
...script/src/features/directiveCommentCompletionProvider.ts
+1
-1
extensions/typescript/src/typescriptMain.ts
extensions/typescript/src/typescriptMain.ts
+19
-34
未找到文件。
extensions/typescript/src/features/directiveCommentCompletionProvider.ts
浏览文件 @
0f1c9696
...
...
@@ -34,7 +34,7 @@ const directives: Directive[] = [
}
];
export
class
DirectiveCommentCompletionProvider
implements
CompletionItemProvider
{
export
default
class
DirectiveCommentCompletionProvider
implements
CompletionItemProvider
{
constructor
(
private
client
:
ITypescriptServiceClient
,
)
{
}
...
...
extensions/typescript/src/typescriptMain.ts
浏览文件 @
0f1c9696
...
...
@@ -24,26 +24,11 @@ import * as PConst from './protocol.const';
import
TypeScriptServiceClient
from
'
./typescriptServiceClient
'
;
import
{
ITypescriptServiceClientHost
}
from
'
./typescriptService
'
;
import
HoverProvider
from
'
./features/hoverProvider
'
;
import
DefinitionProvider
from
'
./features/definitionProvider
'
;
import
ImplementationProvider
from
'
./features/implementationProvider
'
;
import
TypeDefintionProvider
from
'
./features/typeDefinitionProvider
'
;
import
DocumentHighlightProvider
from
'
./features/documentHighlightProvider
'
;
import
ReferenceProvider
from
'
./features/referenceProvider
'
;
import
DocumentSymbolProvider
from
'
./features/documentSymbolProvider
'
;
import
SignatureHelpProvider
from
'
./features/signatureHelpProvider
'
;
import
RenameProvider
from
'
./features/renameProvider
'
;
import
{
TypeScriptFormattingProvider
,
FormattingProviderManager
}
from
'
./features/formattingProvider
'
;
import
BufferSyncSupport
from
'
./features/bufferSyncSupport
'
;
import
CompletionItemProvider
from
'
./features/completionItemProvider
'
;
import
WorkspaceSymbolProvider
from
'
./features/workspaceSymbolProvider
'
;
import
CodeActionProvider
from
'
./features/codeActionProvider
'
;
import
RefactorProvider
from
'
./features/refactorProvider
'
;
import
ReferenceCodeLensProvider
from
'
./features/referencesCodeLensProvider
'
;
import
{
JsDocCompletionProvider
,
TryCompleteJsDocCommand
}
from
'
./features/jsDocCompletionProvider
'
;
import
{
DirectiveCommentCompletionProvider
}
from
'
./features/directiveCommentCompletionProvider
'
;
import
TypeScriptTaskProviderManager
from
'
./features/taskProvider
'
;
import
ImplementationCodeLensProvider
from
'
./features/implementationsCodeLensProvider
'
;
import
*
as
ProjectStatus
from
'
./utils/projectStatus
'
;
import
TypingsStatus
,
{
AtaProgressReporter
}
from
'
./utils/typingsStatus
'
;
...
...
@@ -218,8 +203,8 @@ class LanguageProvider {
workspace
.
onDidChangeConfiguration
(
this
.
configurationChanged
,
this
,
this
.
disposables
);
this
.
configurationChanged
();
client
.
onReady
().
then
(()
=>
{
this
.
registerProviders
(
client
);
client
.
onReady
().
then
(
async
()
=>
{
await
this
.
registerProviders
(
client
);
this
.
bufferSyncSupport
.
listen
();
},
()
=>
{
// Nothing to do here. The client did show a message;
...
...
@@ -246,16 +231,16 @@ class LanguageProvider {
this
.
bufferSyncSupport
.
dispose
();
}
private
registerProviders
(
client
:
TypeScriptServiceClient
):
void
{
private
async
registerProviders
(
client
:
TypeScriptServiceClient
):
Promise
<
void
>
{
const
selector
=
this
.
description
.
modeIds
;
const
config
=
workspace
.
getConfiguration
(
this
.
id
);
const
completionItemProvider
=
new
CompletionItemProvider
(
client
,
this
.
typingsStatus
);
const
completionItemProvider
=
new
(
await
import
(
'
./features/completionItemProvider
'
)).
default
(
client
,
this
.
typingsStatus
);
completionItemProvider
.
updateConfiguration
();
this
.
toUpdateOnConfigurationChanged
.
push
(
completionItemProvider
);
this
.
disposables
.
push
(
languages
.
registerCompletionItemProvider
(
selector
,
completionItemProvider
,
'
.
'
));
this
.
disposables
.
push
(
languages
.
registerCompletionItemProvider
(
selector
,
new
DirectiveCommentCompletionProvider
(
client
),
'
@
'
));
this
.
disposables
.
push
(
languages
.
registerCompletionItemProvider
(
selector
,
new
(
await
import
(
'
./features/directiveCommentCompletionProvider
'
)).
default
(
client
),
'
@
'
));
const
formattingProvider
=
new
TypeScriptFormattingProvider
(
client
);
formattingProvider
.
updateConfiguration
(
config
);
...
...
@@ -270,26 +255,26 @@ class LanguageProvider {
jsDocCompletionProvider
.
updateConfiguration
();
this
.
disposables
.
push
(
languages
.
registerCompletionItemProvider
(
selector
,
jsDocCompletionProvider
,
'
*
'
));
this
.
disposables
.
push
(
languages
.
registerHoverProvider
(
selector
,
new
HoverProvider
(
client
)));
this
.
disposables
.
push
(
languages
.
registerDefinitionProvider
(
selector
,
new
DefinitionProvider
(
client
)));
this
.
disposables
.
push
(
languages
.
registerDocumentHighlightProvider
(
selector
,
new
DocumentHighlightProvider
(
client
)));
this
.
disposables
.
push
(
languages
.
registerReferenceProvider
(
selector
,
new
ReferenceProvider
(
client
)));
this
.
disposables
.
push
(
languages
.
registerDocumentSymbolProvider
(
selector
,
new
DocumentSymbolProvider
(
client
)));
this
.
disposables
.
push
(
languages
.
registerSignatureHelpProvider
(
selector
,
new
SignatureHelpProvider
(
client
),
'
(
'
,
'
,
'
));
this
.
disposables
.
push
(
languages
.
registerRenameProvider
(
selector
,
new
RenameProvider
(
client
)));
this
.
disposables
.
push
(
languages
.
registerCodeActionsProvider
(
selector
,
new
CodeActionProvider
(
client
,
this
.
description
.
id
)));
this
.
disposables
.
push
(
languages
.
registerCodeActionsProvider
(
selector
,
new
RefactorProvider
(
client
,
this
.
description
.
id
)));
this
.
disposables
.
push
(
languages
.
registerHoverProvider
(
selector
,
new
(
await
import
(
'
./features/hoverProvider
'
)).
default
(
client
)));
this
.
disposables
.
push
(
languages
.
registerDefinitionProvider
(
selector
,
new
(
await
import
(
'
./features/definitionProvider
'
)).
default
(
client
)));
this
.
disposables
.
push
(
languages
.
registerDocumentHighlightProvider
(
selector
,
new
(
await
import
(
'
./features/documentHighlightProvider
'
)).
default
(
client
)));
this
.
disposables
.
push
(
languages
.
registerReferenceProvider
(
selector
,
new
(
await
import
(
'
./features/referenceProvider
'
)).
default
(
client
)));
this
.
disposables
.
push
(
languages
.
registerDocumentSymbolProvider
(
selector
,
new
(
await
import
(
'
./features/documentSymbolProvider
'
)).
default
(
client
)));
this
.
disposables
.
push
(
languages
.
registerSignatureHelpProvider
(
selector
,
new
(
await
import
(
'
./features/signatureHelpProvider
'
)).
default
(
client
),
'
(
'
,
'
,
'
));
this
.
disposables
.
push
(
languages
.
registerRenameProvider
(
selector
,
new
(
await
import
(
'
./features/renameProvider
'
)).
default
(
client
)));
this
.
disposables
.
push
(
languages
.
registerCodeActionsProvider
(
selector
,
new
(
await
import
(
'
./features/codeActionProvider
'
)).
default
(
client
,
this
.
description
.
id
)));
this
.
disposables
.
push
(
languages
.
registerCodeActionsProvider
(
selector
,
new
(
await
import
(
'
./features/refactorProvider
'
)).
default
(
client
,
this
.
description
.
id
)));
this
.
registerVersionDependentProviders
();
for
(
const
modeId
of
this
.
description
.
modeIds
)
{
this
.
disposables
.
push
(
languages
.
registerWorkspaceSymbolProvider
(
new
WorkspaceSymbolProvider
(
client
,
modeId
)));
const
referenceCodeLensProvider
=
new
ReferenceCodeLensProvider
(
client
,
modeId
);
const
referenceCodeLensProvider
=
new
(
await
import
(
'
./features/referencesCodeLensProvider
'
)).
default
(
client
,
modeId
);
referenceCodeLensProvider
.
updateConfiguration
();
this
.
toUpdateOnConfigurationChanged
.
push
(
referenceCodeLensProvider
);
this
.
disposables
.
push
(
languages
.
registerCodeLensProvider
(
selector
,
referenceCodeLensProvider
));
const
implementationCodeLensProvider
=
new
ImplementationCodeLensProvider
(
client
,
modeId
);
const
implementationCodeLensProvider
=
new
(
await
import
(
'
./features/implementationsCodeLensProvider
'
)).
default
(
client
,
modeId
);
implementationCodeLensProvider
.
updateConfiguration
();
this
.
toUpdateOnConfigurationChanged
.
push
(
implementationCodeLensProvider
);
this
.
disposables
.
push
(
languages
.
registerCodeLensProvider
(
selector
,
implementationCodeLensProvider
));
...
...
@@ -388,7 +373,7 @@ class LanguageProvider {
this
.
registerVersionDependentProviders
();
}
private
registerVersionDependentProviders
():
void
{
private
async
registerVersionDependentProviders
():
Promise
<
void
>
{
while
(
this
.
versionDependentDisposables
.
length
)
{
const
obj
=
this
.
versionDependentDisposables
.
pop
();
if
(
obj
)
{
...
...
@@ -403,11 +388,11 @@ class LanguageProvider {
const
selector
=
this
.
description
.
modeIds
;
if
(
this
.
client
.
apiVersion
.
has220Features
())
{
this
.
versionDependentDisposables
.
push
(
languages
.
registerImplementationProvider
(
selector
,
new
ImplementationProvider
(
this
.
client
)));
this
.
versionDependentDisposables
.
push
(
languages
.
registerImplementationProvider
(
selector
,
new
(
await
import
(
'
./features/implementationProvider
'
)).
default
(
this
.
client
)));
}
if
(
this
.
client
.
apiVersion
.
has213Features
())
{
this
.
versionDependentDisposables
.
push
(
languages
.
registerTypeDefinitionProvider
(
selector
,
new
TypeDefintionProvider
(
this
.
client
)));
this
.
versionDependentDisposables
.
push
(
languages
.
registerTypeDefinitionProvider
(
selector
,
new
(
await
import
(
'
./features/typeDefinitionProvider
'
)).
default
(
this
.
client
)));
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录