Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ad8d18ed
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,发现更多精彩内容 >>
提交
ad8d18ed
编写于
12月 04, 2018
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Match signature context field name to type name
上级
5010af11
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
27 addition
and
27 deletion
+27
-27
extensions/typescript-language-features/src/features/signatureHelp.ts
...ypescript-language-features/src/features/signatureHelp.ts
+3
-3
src/vs/editor/common/modes.ts
src/vs/editor/common/modes.ts
+1
-1
src/vs/editor/contrib/parameterHints/parameterHints.ts
src/vs/editor/contrib/parameterHints/parameterHints.ts
+1
-1
src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts
src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts
+5
-5
src/vs/editor/contrib/parameterHints/provideSignatureHelp.ts
src/vs/editor/contrib/parameterHints/provideSignatureHelp.ts
+1
-1
src/vs/editor/contrib/parameterHints/test/parameterHintsModel.test.ts
...r/contrib/parameterHints/test/parameterHintsModel.test.ts
+12
-12
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+1
-1
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+1
-1
src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts
...test/electron-browser/api/extHostLanguageFeatures.test.ts
+2
-2
未找到文件。
extensions/typescript-language-features/src/features/signatureHelp.ts
浏览文件 @
ad8d18ed
...
...
@@ -22,7 +22,7 @@ class TypeScriptSignatureHelpProvider implements vscode.SignatureHelpProvider {
document
:
vscode
.
TextDocument
,
position
:
vscode
.
Position
,
token
:
vscode
.
CancellationToken
,
context
?
:
vscode
.
SignatureHelpContext
,
context
:
vscode
.
SignatureHelpContext
,
):
Promise
<
vscode
.
SignatureHelp
|
undefined
>
{
const
filepath
=
this
.
client
.
toPath
(
document
.
uri
);
if
(
!
filepath
)
{
...
...
@@ -31,7 +31,7 @@ class TypeScriptSignatureHelpProvider implements vscode.SignatureHelpProvider {
const
args
:
Proto
.
SignatureHelpRequestArgs
=
{
...
typeConverters
.
Position
.
toFileLocationRequestArgs
(
filepath
,
position
),
triggerReason
:
toTsTriggerReason
(
context
!
)
triggerReason
:
toTsTriggerReason
(
context
)
};
const
response
=
await
this
.
client
.
interuptGetErr
(()
=>
this
.
client
.
execute
(
'
signatureHelp
'
,
args
,
token
));
if
(
response
.
type
!==
'
response
'
||
!
response
.
body
)
{
...
...
@@ -72,7 +72,7 @@ class TypeScriptSignatureHelpProvider implements vscode.SignatureHelpProvider {
}
function
toTsTriggerReason
(
context
:
vscode
.
SignatureHelpContext
):
Proto
.
SignatureHelpTriggerReason
{
switch
(
context
.
trigger
Reason
)
{
switch
(
context
.
trigger
Kind
)
{
case
vscode
.
SignatureHelpTriggerKind
.
TriggerCharacter
:
if
(
context
.
triggerCharacter
)
{
if
(
context
.
isRetrigger
)
{
...
...
src/vs/editor/common/modes.ts
浏览文件 @
ad8d18ed
...
...
@@ -622,7 +622,7 @@ export enum SignatureHelpTriggerKind {
}
export
interface
SignatureHelpContext
{
readonly
trigger
Reason
:
SignatureHelpTriggerKind
;
readonly
trigger
Kind
:
SignatureHelpTriggerKind
;
readonly
triggerCharacter
?:
string
;
readonly
isRetrigger
:
boolean
;
}
...
...
src/vs/editor/contrib/parameterHints/parameterHints.ts
浏览文件 @
ad8d18ed
...
...
@@ -78,7 +78,7 @@ export class TriggerParameterHintsAction extends EditorAction {
let
controller
=
ParameterHintsController
.
get
(
editor
);
if
(
controller
)
{
controller
.
trigger
({
trigger
Reason
:
modes
.
SignatureHelpTriggerKind
.
Invoke
trigger
Kind
:
modes
.
SignatureHelpTriggerKind
.
Invoke
});
}
}
...
...
src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts
浏览文件 @
ad8d18ed
...
...
@@ -29,7 +29,7 @@ import { MarkdownRenderer } from 'vs/editor/contrib/markdown/markdownRenderer';
const
$
=
dom
.
$
;
export
interface
TriggerContext
{
readonly
trigger
Reason
:
modes
.
SignatureHelpTriggerKind
;
readonly
trigger
Kind
:
modes
.
SignatureHelpTriggerKind
;
readonly
triggerCharacter
?:
string
;
}
...
...
@@ -107,7 +107,7 @@ export class ParameterHintsModel extends Disposable {
this
.
throttledDelayer
.
trigger
(
()
=>
this
.
doTrigger
({
trigger
Reason
:
context
.
triggerReason
,
trigger
Kind
:
context
.
triggerKind
,
triggerCharacter
:
context
.
triggerCharacter
,
isRetrigger
:
this
.
isTriggered
,
}),
delay
).
then
(
undefined
,
onUnexpectedError
);
...
...
@@ -193,7 +193,7 @@ export class ParameterHintsModel extends Disposable {
if
(
this
.
triggerChars
.
has
(
triggerCharCode
)
||
this
.
isTriggered
&&
this
.
retriggerChars
.
has
(
triggerCharCode
))
{
this
.
trigger
({
trigger
Reason
:
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
,
trigger
Kind
:
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
,
triggerCharacter
:
text
.
charAt
(
lastCharIndex
),
});
}
...
...
@@ -203,13 +203,13 @@ export class ParameterHintsModel extends Disposable {
if
(
e
.
source
===
'
mouse
'
)
{
this
.
cancel
();
}
else
if
(
this
.
isTriggered
)
{
this
.
trigger
({
trigger
Reason
:
modes
.
SignatureHelpTriggerKind
.
ContentChange
});
this
.
trigger
({
trigger
Kind
:
modes
.
SignatureHelpTriggerKind
.
ContentChange
});
}
}
private
onModelContentChange
():
void
{
if
(
this
.
isTriggered
)
{
this
.
trigger
({
trigger
Reason
:
modes
.
SignatureHelpTriggerKind
.
ContentChange
});
this
.
trigger
({
trigger
Kind
:
modes
.
SignatureHelpTriggerKind
.
ContentChange
});
}
}
...
...
src/vs/editor/contrib/parameterHints/provideSignatureHelp.ts
浏览文件 @
ad8d18ed
...
...
@@ -28,6 +28,6 @@ export function provideSignatureHelp(model: ITextModel, position: Position, cont
registerDefaultLanguageCommand
(
'
_executeSignatureHelpProvider
'
,
(
model
,
position
)
=>
provideSignatureHelp
(
model
,
position
,
{
trigger
Reason
:
modes
.
SignatureHelpTriggerKind
.
Invoke
,
trigger
Kind
:
modes
.
SignatureHelpTriggerKind
.
Invoke
,
isRetrigger
:
false
},
CancellationToken
.
None
));
src/vs/editor/contrib/parameterHints/test/parameterHintsModel.test.ts
浏览文件 @
ad8d18ed
...
...
@@ -63,7 +63,7 @@ suite('ParameterHintsModel', () => {
signatureHelpRetriggerCharacters
=
[];
provideSignatureHelp
(
_model
:
ITextModel
,
_position
:
Position
,
_token
:
CancellationToken
,
context
:
modes
.
SignatureHelpContext
):
modes
.
SignatureHelp
|
Thenable
<
modes
.
SignatureHelp
>
{
assert
.
strictEqual
(
context
.
trigger
Reason
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
trigger
Kind
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
triggerCharacter
,
triggerChar
);
done
();
return
undefined
;
...
...
@@ -87,13 +87,13 @@ suite('ParameterHintsModel', () => {
provideSignatureHelp
(
_model
:
ITextModel
,
_position
:
Position
,
_token
:
CancellationToken
,
context
:
modes
.
SignatureHelpContext
):
modes
.
SignatureHelp
|
Thenable
<
modes
.
SignatureHelp
>
{
++
invokeCount
;
if
(
invokeCount
===
1
)
{
assert
.
strictEqual
(
context
.
trigger
Reason
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
trigger
Kind
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
triggerCharacter
,
triggerChar
);
// Retrigger
editor
.
trigger
(
'
keyboard
'
,
Handler
.
Type
,
{
text
:
triggerChar
});
}
else
{
assert
.
strictEqual
(
invokeCount
,
2
);
assert
.
strictEqual
(
context
.
trigger
Reason
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
trigger
Kind
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
ok
(
context
.
isRetrigger
);
assert
.
strictEqual
(
context
.
triggerCharacter
,
triggerChar
);
done
();
...
...
@@ -120,7 +120,7 @@ suite('ParameterHintsModel', () => {
provideSignatureHelp
(
_model
:
ITextModel
,
_position
:
Position
,
_token
:
CancellationToken
,
context
:
modes
.
SignatureHelpContext
):
modes
.
SignatureHelp
|
Thenable
<
modes
.
SignatureHelp
>
{
++
invokeCount
;
if
(
invokeCount
===
1
)
{
assert
.
strictEqual
(
context
.
trigger
Reason
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
trigger
Kind
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
triggerCharacter
,
triggerChar
);
// Cancel and retrigger
...
...
@@ -128,7 +128,7 @@ suite('ParameterHintsModel', () => {
editor
.
trigger
(
'
keyboard
'
,
Handler
.
Type
,
{
text
:
triggerChar
});
}
else
{
assert
.
strictEqual
(
invokeCount
,
2
);
assert
.
strictEqual
(
context
.
trigger
Reason
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
trigger
Kind
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
triggerCharacter
,
triggerChar
);
done
();
}
...
...
@@ -151,7 +151,7 @@ suite('ParameterHintsModel', () => {
provideSignatureHelp
(
_model
:
ITextModel
,
_position
:
Position
,
_token
:
CancellationToken
,
context
:
modes
.
SignatureHelpContext
):
modes
.
SignatureHelp
|
Thenable
<
modes
.
SignatureHelp
>
{
++
invokeCount
;
assert
.
strictEqual
(
context
.
trigger
Reason
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
trigger
Kind
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
isRetrigger
,
false
);
assert
.
strictEqual
(
context
.
triggerCharacter
,
'
c
'
);
...
...
@@ -182,13 +182,13 @@ suite('ParameterHintsModel', () => {
provideSignatureHelp
(
_model
:
ITextModel
,
_position
:
Position
,
_token
:
CancellationToken
,
context
:
modes
.
SignatureHelpContext
):
modes
.
SignatureHelp
|
Thenable
<
modes
.
SignatureHelp
>
{
++
invokeCount
;
if
(
invokeCount
===
1
)
{
assert
.
strictEqual
(
context
.
trigger
Reason
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
trigger
Kind
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
triggerCharacter
,
'
a
'
);
// retrigger after delay for widget to show up
setTimeout
(()
=>
editor
.
trigger
(
'
keyboard
'
,
Handler
.
Type
,
{
text
:
'
b
'
}),
50
);
}
else
if
(
invokeCount
===
2
)
{
assert
.
strictEqual
(
context
.
trigger
Reason
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
trigger
Kind
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
ok
(
context
.
isRetrigger
);
assert
.
strictEqual
(
context
.
triggerCharacter
,
'
b
'
);
done
();
...
...
@@ -220,7 +220,7 @@ suite('ParameterHintsModel', () => {
// retrigger on first request
if
(
count
===
0
)
{
hintsModel
.
trigger
({
trigger
Reason
:
modes
.
SignatureHelpTriggerKind
.
Invoke
},
0
);
hintsModel
.
trigger
({
trigger
Kind
:
modes
.
SignatureHelpTriggerKind
.
Invoke
},
0
);
}
return
new
Promise
<
modes
.
SignatureHelp
>
(
resolve
=>
{
...
...
@@ -240,7 +240,7 @@ suite('ParameterHintsModel', () => {
disposables
.
push
(
modes
.
SignatureHelpProviderRegistry
.
register
(
mockFileSelector
,
longRunningProvider
));
hintsModel
.
trigger
({
trigger
Reason
:
modes
.
SignatureHelpTriggerKind
.
Invoke
},
0
);
hintsModel
.
trigger
({
trigger
Kind
:
modes
.
SignatureHelpTriggerKind
.
Invoke
},
0
);
assert
.
strictEqual
(
-
1
,
didRequestCancellationOf
);
return
new
Promise
((
resolve
,
reject
)
=>
...
...
@@ -270,13 +270,13 @@ suite('ParameterHintsModel', () => {
provideSignatureHelp
(
_model
:
ITextModel
,
_position
:
Position
,
_token
:
CancellationToken
,
context
:
modes
.
SignatureHelpContext
):
modes
.
SignatureHelp
|
Thenable
<
modes
.
SignatureHelp
>
{
++
invokeCount
;
if
(
invokeCount
===
1
)
{
assert
.
strictEqual
(
context
.
trigger
Reason
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
trigger
Kind
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
triggerCharacter
,
triggerChar
);
// retrigger after delay for widget to show up
setTimeout
(()
=>
editor
.
trigger
(
'
keyboard
'
,
Handler
.
Type
,
{
text
:
retriggerChar
}),
50
);
}
else
if
(
invokeCount
===
2
)
{
assert
.
strictEqual
(
context
.
trigger
Reason
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
strictEqual
(
context
.
trigger
Kind
,
modes
.
SignatureHelpTriggerKind
.
TriggerCharacter
);
assert
.
ok
(
context
.
isRetrigger
);
assert
.
strictEqual
(
context
.
triggerCharacter
,
retriggerChar
);
done
();
...
...
src/vs/monaco.d.ts
浏览文件 @
ad8d18ed
...
...
@@ -4934,7 +4934,7 @@ declare namespace monaco.languages {
}
export
interface
SignatureHelpContext
{
readonly
trigger
Reason
:
SignatureHelpTriggerKind
;
readonly
trigger
Kind
:
SignatureHelpTriggerKind
;
readonly
triggerCharacter
?:
string
;
readonly
isRetrigger
:
boolean
;
}
...
...
src/vs/vscode.d.ts
浏览文件 @
ad8d18ed
...
...
@@ -3151,7 +3151,7 @@ declare module 'vscode' {
/**
* Action that caused signature help to be triggered.
*/
readonly
trigger
Reason
:
SignatureHelpTriggerKind
;
readonly
trigger
Kind
:
SignatureHelpTriggerKind
;
/**
* Character that caused signature help to be triggered.
...
...
src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts
浏览文件 @
ad8d18ed
...
...
@@ -887,7 +887,7 @@ suite('ExtHostLanguageFeatures', function () {
return
rpcProtocol
.
sync
().
then
(()
=>
{
return
provideSignatureHelp
(
model
,
new
EditorPosition
(
1
,
1
),
{
trigger
Reason
:
modes
.
SignatureHelpTriggerKind
.
Invoke
,
isRetrigger
:
false
},
CancellationToken
.
None
).
then
(
value
=>
{
return
provideSignatureHelp
(
model
,
new
EditorPosition
(
1
,
1
),
{
trigger
Kind
:
modes
.
SignatureHelpTriggerKind
.
Invoke
,
isRetrigger
:
false
},
CancellationToken
.
None
).
then
(
value
=>
{
assert
.
ok
(
value
);
});
});
...
...
@@ -902,7 +902,7 @@ suite('ExtHostLanguageFeatures', function () {
return
rpcProtocol
.
sync
().
then
(()
=>
{
return
provideSignatureHelp
(
model
,
new
EditorPosition
(
1
,
1
),
{
trigger
Reason
:
modes
.
SignatureHelpTriggerKind
.
Invoke
,
isRetrigger
:
false
},
CancellationToken
.
None
).
then
(
value
=>
{
return
provideSignatureHelp
(
model
,
new
EditorPosition
(
1
,
1
),
{
trigger
Kind
:
modes
.
SignatureHelpTriggerKind
.
Invoke
,
isRetrigger
:
false
},
CancellationToken
.
None
).
then
(
value
=>
{
assert
.
equal
(
value
,
undefined
);
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录