Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9f533655
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,发现更多精彩内容 >>
提交
9f533655
编写于
11月 19, 2018
作者:
S
SteVen Batten
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
https://github.com/Microsoft/vscode
上级
87b9be19
ebe9ea85
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
8 deletion
+14
-8
extensions/typescript-language-features/src/api.ts
extensions/typescript-language-features/src/api.ts
+1
-1
extensions/typescript-language-features/src/features/completions.ts
.../typescript-language-features/src/features/completions.ts
+10
-6
src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts
...s/editor/contrib/goToDefinition/goToDefinitionCommands.ts
+3
-1
未找到文件。
extensions/typescript-language-features/src/api.ts
浏览文件 @
9f533655
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
import
*
as
vscode
from
'
vscode
'
;
import
*
as
vscode
from
'
vscode
'
;
interface
ApiV0
{
interface
ApiV0
{
readonly
onCompletionAccepted
:
vscode
.
Event
<
vscode
.
CompletionItem
>
;
readonly
onCompletionAccepted
:
vscode
.
Event
<
vscode
.
CompletionItem
&
{
metadata
?:
any
}
>
;
}
}
export
interface
Api
{
export
interface
Api
{
...
...
extensions/typescript-language-features/src/features/completions.ts
浏览文件 @
9f533655
...
@@ -36,7 +36,8 @@ class MyCompletionItem extends vscode.CompletionItem {
...
@@ -36,7 +36,8 @@ class MyCompletionItem extends vscode.CompletionItem {
line
:
string
,
line
:
string
,
public
readonly
tsEntry
:
Proto
.
CompletionEntry
,
public
readonly
tsEntry
:
Proto
.
CompletionEntry
,
useCodeSnippetsOnMethodSuggest
:
boolean
,
useCodeSnippetsOnMethodSuggest
:
boolean
,
public
readonly
commitCharactersSettings
:
CommitCharactersSettings
public
readonly
commitCharactersSettings
:
CommitCharactersSettings
,
public
readonly
metadata
:
any
|
undefined
,
)
{
)
{
super
(
tsEntry
.
name
,
MyCompletionItem
.
convertKind
(
tsEntry
.
kind
));
super
(
tsEntry
.
name
,
MyCompletionItem
.
convertKind
(
tsEntry
.
kind
));
...
@@ -362,7 +363,8 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider
...
@@ -362,7 +363,8 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider
let
isNewIdentifierLocation
=
true
;
let
isNewIdentifierLocation
=
true
;
let
isIncomplete
=
false
;
let
isIncomplete
=
false
;
let
msg
:
ReadonlyArray
<
Proto
.
CompletionEntry
>
;
let
entries
:
ReadonlyArray
<
Proto
.
CompletionEntry
>
;
let
metadata
:
any
|
undefined
;
if
(
this
.
client
.
apiVersion
.
gte
(
API
.
v300
))
{
if
(
this
.
client
.
apiVersion
.
gte
(
API
.
v300
))
{
const
response
=
await
this
.
client
.
interuptGetErr
(()
=>
this
.
client
.
execute
(
'
completionInfo
'
,
args
,
token
));
const
response
=
await
this
.
client
.
interuptGetErr
(()
=>
this
.
client
.
execute
(
'
completionInfo
'
,
args
,
token
));
if
(
response
.
type
!==
'
response
'
||
!
response
.
body
)
{
if
(
response
.
type
!==
'
response
'
||
!
response
.
body
)
{
...
@@ -370,24 +372,26 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider
...
@@ -370,24 +372,26 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider
}
}
isNewIdentifierLocation
=
response
.
body
.
isNewIdentifierLocation
;
isNewIdentifierLocation
=
response
.
body
.
isNewIdentifierLocation
;
isIncomplete
=
(
response
as
any
).
metadata
&&
(
response
as
any
).
metadata
.
isIncomplete
;
isIncomplete
=
(
response
as
any
).
metadata
&&
(
response
as
any
).
metadata
.
isIncomplete
;
msg
=
response
.
body
.
entries
;
entries
=
response
.
body
.
entries
;
metadata
=
response
.
metadata
;
}
else
{
}
else
{
const
response
=
await
this
.
client
.
interuptGetErr
(()
=>
this
.
client
.
execute
(
'
completions
'
,
args
,
token
));
const
response
=
await
this
.
client
.
interuptGetErr
(()
=>
this
.
client
.
execute
(
'
completions
'
,
args
,
token
));
if
(
response
.
type
!==
'
response
'
||
!
response
.
body
)
{
if
(
response
.
type
!==
'
response
'
||
!
response
.
body
)
{
return
null
;
return
null
;
}
}
msg
=
response
.
body
;
entries
=
response
.
body
;
metadata
=
response
.
metadata
;
}
}
const
isInValidCommitCharacterContext
=
this
.
isInValidCommitCharacterContext
(
document
,
position
);
const
isInValidCommitCharacterContext
=
this
.
isInValidCommitCharacterContext
(
document
,
position
);
const
items
=
msg
const
items
=
entries
.
filter
(
entry
=>
!
shouldExcludeCompletionEntry
(
entry
,
completionConfiguration
))
.
filter
(
entry
=>
!
shouldExcludeCompletionEntry
(
entry
,
completionConfiguration
))
.
map
(
entry
=>
new
MyCompletionItem
(
position
,
document
,
line
.
text
,
entry
,
completionConfiguration
.
useCodeSnippetsOnMethodSuggest
,
{
.
map
(
entry
=>
new
MyCompletionItem
(
position
,
document
,
line
.
text
,
entry
,
completionConfiguration
.
useCodeSnippetsOnMethodSuggest
,
{
isNewIdentifierLocation
,
isNewIdentifierLocation
,
isInValidCommitCharacterContext
,
isInValidCommitCharacterContext
,
enableCallCompletions
:
!
completionConfiguration
.
useCodeSnippetsOnMethodSuggest
enableCallCompletions
:
!
completionConfiguration
.
useCodeSnippetsOnMethodSuggest
}));
}
,
metadata
));
return
new
vscode
.
CompletionList
(
items
,
isIncomplete
);
return
new
vscode
.
CompletionList
(
items
,
isIncomplete
);
}
}
...
...
src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts
浏览文件 @
9f533655
...
@@ -268,9 +268,11 @@ export class DeclarationAction extends DefinitionAction {
...
@@ -268,9 +268,11 @@ export class DeclarationAction extends DefinitionAction {
export
class
GoToDeclarationAction
extends
DeclarationAction
{
export
class
GoToDeclarationAction
extends
DeclarationAction
{
public
static
readonly
ID
=
'
editor.action.goToRealDeclaration
'
;
constructor
()
{
constructor
()
{
super
(
new
DefinitionActionConfig
(),
{
super
(
new
DefinitionActionConfig
(),
{
id
:
'
editor.action.goToDeclaration
'
,
id
:
GoToDeclarationAction
.
ID
,
label
:
nls
.
localize
(
'
actions.goToDeclaration.label
'
,
"
Go to Declaration
"
),
label
:
nls
.
localize
(
'
actions.goToDeclaration.label
'
,
"
Go to Declaration
"
),
alias
:
'
Go to Declaration
'
,
alias
:
'
Go to Declaration
'
,
precondition
:
ContextKeyExpr
.
and
(
precondition
:
ContextKeyExpr
.
and
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录