Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
98605b6a
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,发现更多精彩内容 >>
提交
98605b6a
编写于
12月 07, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Extract cached response to own file
上级
fee735ed
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
40 addition
and
36 deletion
+40
-36
extensions/typescript-language-features/src/features/baseCodeLensProvider.ts
...pt-language-features/src/features/baseCodeLensProvider.ts
+2
-32
extensions/typescript-language-features/src/features/documentSymbol.ts
...pescript-language-features/src/features/documentSymbol.ts
+1
-1
extensions/typescript-language-features/src/features/implementationsCodeLens.ts
...language-features/src/features/implementationsCodeLens.ts
+2
-1
extensions/typescript-language-features/src/features/referencesCodeLens.ts
...ript-language-features/src/features/referencesCodeLens.ts
+2
-1
extensions/typescript-language-features/src/languageProvider.ts
...ions/typescript-language-features/src/languageProvider.ts
+1
-1
extensions/typescript-language-features/src/tsServer/cachedResponse.ts
...pescript-language-features/src/tsServer/cachedResponse.ts
+32
-0
未找到文件。
extensions/typescript-language-features/src/features/baseCodeLensProvider.ts
浏览文件 @
98605b6a
...
...
@@ -6,9 +6,10 @@
import
*
as
vscode
from
'
vscode
'
;
import
*
as
nls
from
'
vscode-nls
'
;
import
*
as
Proto
from
'
../protocol
'
;
import
{
ITypeScriptServiceClient
,
ServerResponse
}
from
'
../typescriptService
'
;
import
{
ITypeScriptServiceClient
}
from
'
../typescriptService
'
;
import
{
escapeRegExp
}
from
'
../utils/regexp
'
;
import
*
as
typeConverters
from
'
../utils/typeConverters
'
;
import
{
CachedResponse
}
from
'
../tsServer/cachedResponse
'
;
const
localize
=
nls
.
loadMessageBundle
();
...
...
@@ -22,37 +23,6 @@ export class ReferencesCodeLens extends vscode.CodeLens {
}
}
export
class
CachedResponse
<
T
extends
Proto
.
Response
>
{
private
response
?:
Promise
<
ServerResponse
<
T
>>
;
private
version
:
number
=
-
1
;
private
document
:
string
=
''
;
public
execute
(
document
:
vscode
.
TextDocument
,
f
:
()
=>
Promise
<
ServerResponse
<
T
>>
)
{
if
(
this
.
matches
(
document
))
{
return
this
.
response
;
}
return
this
.
update
(
document
,
f
());
}
private
matches
(
document
:
vscode
.
TextDocument
):
boolean
{
return
this
.
version
===
document
.
version
&&
this
.
document
===
document
.
uri
.
toString
();
}
private
update
(
document
:
vscode
.
TextDocument
,
response
:
Promise
<
ServerResponse
<
T
>>
):
Promise
<
ServerResponse
<
T
>>
{
this
.
response
=
response
;
this
.
version
=
document
.
version
;
this
.
document
=
document
.
uri
.
toString
();
return
response
;
}
}
export
abstract
class
TypeScriptBaseCodeLensProvider
implements
vscode
.
CodeLensProvider
{
public
static
readonly
cancelledCommand
:
vscode
.
Command
=
{
...
...
extensions/typescript-language-features/src/features/documentSymbol.ts
浏览文件 @
98605b6a
...
...
@@ -8,7 +8,7 @@ import * as Proto from '../protocol';
import
*
as
PConst
from
'
../protocol.const
'
;
import
{
ITypeScriptServiceClient
}
from
'
../typescriptService
'
;
import
*
as
typeConverters
from
'
../utils/typeConverters
'
;
import
{
CachedResponse
}
from
'
.
/baseCodeLensProvider
'
;
import
{
CachedResponse
}
from
'
.
./tsServer/cachedResponse
'
;
const
getSymbolKind
=
(
kind
:
string
):
vscode
.
SymbolKind
=>
{
switch
(
kind
)
{
...
...
extensions/typescript-language-features/src/features/implementationsCodeLens.ts
浏览文件 @
98605b6a
...
...
@@ -10,7 +10,8 @@ import * as PConst from '../protocol.const';
import
{
ITypeScriptServiceClient
}
from
'
../typescriptService
'
;
import
API
from
'
../utils/api
'
;
import
{
ConfigurationDependentRegistration
,
VersionDependentRegistration
}
from
'
../utils/dependentRegistration
'
;
import
{
TypeScriptBaseCodeLensProvider
,
ReferencesCodeLens
,
getSymbolRange
,
CachedResponse
}
from
'
./baseCodeLensProvider
'
;
import
{
TypeScriptBaseCodeLensProvider
,
ReferencesCodeLens
,
getSymbolRange
}
from
'
./baseCodeLensProvider
'
;
import
{
CachedResponse
}
from
'
../tsServer/cachedResponse
'
;
import
*
as
typeConverters
from
'
../utils/typeConverters
'
;
const
localize
=
nls
.
loadMessageBundle
();
...
...
extensions/typescript-language-features/src/features/referencesCodeLens.ts
浏览文件 @
98605b6a
...
...
@@ -11,7 +11,8 @@ import { ITypeScriptServiceClient } from '../typescriptService';
import
API
from
'
../utils/api
'
;
import
{
ConfigurationDependentRegistration
,
VersionDependentRegistration
}
from
'
../utils/dependentRegistration
'
;
import
*
as
typeConverters
from
'
../utils/typeConverters
'
;
import
{
ReferencesCodeLens
,
TypeScriptBaseCodeLensProvider
,
getSymbolRange
,
CachedResponse
}
from
'
./baseCodeLensProvider
'
;
import
{
ReferencesCodeLens
,
TypeScriptBaseCodeLensProvider
,
getSymbolRange
}
from
'
./baseCodeLensProvider
'
;
import
{
CachedResponse
}
from
'
../tsServer/cachedResponse
'
;
const
localize
=
nls
.
loadMessageBundle
();
...
...
extensions/typescript-language-features/src/languageProvider.ts
浏览文件 @
98605b6a
...
...
@@ -5,7 +5,7 @@
import
{
basename
}
from
'
path
'
;
import
*
as
vscode
from
'
vscode
'
;
import
{
CachedResponse
}
from
'
./
features/baseCodeLensProvider
'
;
import
{
CachedResponse
}
from
'
./
tsServer/cachedResponse
'
;
import
{
DiagnosticKind
}
from
'
./features/diagnostics
'
;
import
FileConfigurationManager
from
'
./features/fileConfigurationManager
'
;
import
TypeScriptServiceClient
from
'
./typescriptServiceClient
'
;
...
...
extensions/typescript-language-features/src/tsServer/cachedResponse.ts
0 → 100644
浏览文件 @
98605b6a
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
*
as
vscode
from
'
vscode
'
;
import
*
as
Proto
from
'
../protocol
'
;
import
{
ServerResponse
}
from
'
../typescriptService
'
;
export
class
CachedResponse
<
T
extends
Proto
.
Response
>
{
private
response
?:
Promise
<
ServerResponse
<
T
>>
;
private
version
:
number
=
-
1
;
private
document
:
string
=
''
;
public
execute
(
document
:
vscode
.
TextDocument
,
f
:
()
=>
Promise
<
ServerResponse
<
T
>>
)
{
if
(
this
.
matches
(
document
))
{
return
this
.
response
;
}
return
this
.
update
(
document
,
f
());
}
private
matches
(
document
:
vscode
.
TextDocument
):
boolean
{
return
this
.
version
===
document
.
version
&&
this
.
document
===
document
.
uri
.
toString
();
}
private
update
(
document
:
vscode
.
TextDocument
,
response
:
Promise
<
ServerResponse
<
T
>>
):
Promise
<
ServerResponse
<
T
>>
{
this
.
response
=
response
;
this
.
version
=
document
.
version
;
this
.
document
=
document
.
uri
.
toString
();
return
response
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录