Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f3993616
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,发现更多精彩内容 >>
提交
f3993616
编写于
6月 02, 2016
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
parameter hints
💄
上级
ea75c05c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
156 addition
and
174 deletion
+156
-174
src/vs/editor/contrib/parameterHints/browser/parameterHints.ts
...s/editor/contrib/parameterHints/browser/parameterHints.ts
+13
-26
src/vs/editor/contrib/parameterHints/browser/parameterHintsModel.ts
...tor/contrib/parameterHints/browser/parameterHintsModel.ts
+0
-129
src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts
...or/contrib/parameterHints/browser/parameterHintsWidget.ts
+139
-19
src/vs/editor/contrib/parameterHints/common/parameterHints.ts
...vs/editor/contrib/parameterHints/common/parameterHints.ts
+4
-0
未找到文件。
src/vs/editor/contrib/parameterHints/browser/parameterHints.ts
浏览文件 @
f3993616
...
@@ -7,17 +7,16 @@
...
@@ -7,17 +7,16 @@
import
*
as
nls
from
'
vs/nls
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IKeybindingContextKey
,
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
EditorAction
}
from
'
vs/editor/common/editorAction
'
;
import
{
EditorAction
}
from
'
vs/editor/common/editorAction
'
;
import
{
ICommonCodeEditor
,
IEditorActionDescriptorData
,
IEditorContribution
}
from
'
vs/editor/common/editorCommon
'
;
import
{
ICommonCodeEditor
,
IEditorActionDescriptorData
,
IEditorContribution
}
from
'
vs/editor/common/editorCommon
'
;
import
{
CommonEditorRegistry
,
ContextKey
,
EditorActionDescriptor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
CommonEditorRegistry
,
ContextKey
,
EditorActionDescriptor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
EditorBrowserRegistry
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
EditorBrowserRegistry
}
from
'
vs/editor/browser/editorBrowserExtensions
'
;
import
{
SignatureHelpProviderRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
SignatureHelpProviderRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
ParameterHintsModel
}
from
'
./parameterHintsModel
'
;
import
{
ParameterHintsWidget
}
from
'
./parameterHintsWidget
'
;
import
{
ParameterHintsWidget
}
from
'
./parameterHintsWidget
'
;
import
{
Context
}
from
'
../common/parameterHints
'
;
const
CONTEXT_PARAMETER_HINTS_VISIBLE
=
'
parameterHintsVisible
'
;
class
ParameterHintsController
implements
IEditorContribution
{
class
ParameterHintsController
implements
IEditorContribution
{
...
@@ -28,27 +27,11 @@ class ParameterHintsController implements IEditorContribution {
...
@@ -28,27 +27,11 @@ class ParameterHintsController implements IEditorContribution {
}
}
private
editor
:
ICodeEditor
;
private
editor
:
ICodeEditor
;
private
model
:
ParameterHintsModel
;
private
widget
:
ParameterHintsWidget
;
private
widget
:
ParameterHintsWidget
;
private
parameterHintsVisible
:
IKeybindingContextKey
<
boolean
>
;
constructor
(
editor
:
ICodeEditor
,
@
I
KeybindingService
keybindingService
:
IKeybinding
Service
)
{
constructor
(
editor
:
ICodeEditor
,
@
I
InstantiationService
instantiationService
:
IInstantiation
Service
)
{
this
.
editor
=
editor
;
this
.
editor
=
editor
;
this
.
model
=
new
ParameterHintsModel
(
this
.
editor
);
this
.
widget
=
instantiationService
.
createInstance
(
ParameterHintsWidget
,
this
.
editor
);
this
.
parameterHintsVisible
=
keybindingService
.
createKey
(
CONTEXT_PARAMETER_HINTS_VISIBLE
,
false
);
this
.
widget
=
new
ParameterHintsWidget
(
this
.
model
,
this
.
editor
,
()
=>
{
this
.
parameterHintsVisible
.
set
(
true
);
},
()
=>
{
this
.
parameterHintsVisible
.
reset
();
});
}
dispose
():
void
{
this
.
model
.
dispose
();
this
.
model
=
null
;
this
.
widget
.
destroy
();
this
.
widget
=
null
;
}
}
getId
():
string
{
getId
():
string
{
...
@@ -68,7 +51,11 @@ class ParameterHintsController implements IEditorContribution {
...
@@ -68,7 +51,11 @@ class ParameterHintsController implements IEditorContribution {
}
}
trigger
():
void
{
trigger
():
void
{
this
.
model
.
trigger
(
0
);
this
.
widget
.
trigger
();
}
dispose
():
void
{
this
.
widget
=
dispose
(
this
.
widget
);
}
}
}
}
...
@@ -111,7 +98,7 @@ CommonEditorRegistry.registerEditorCommand(
...
@@ -111,7 +98,7 @@ CommonEditorRegistry.registerEditorCommand(
weight
,
weight
,
{
primary
:
KeyCode
.
Escape
,
secondary
:
[
KeyMod
.
Shift
|
KeyCode
.
Escape
]
},
{
primary
:
KeyCode
.
Escape
,
secondary
:
[
KeyMod
.
Shift
|
KeyCode
.
Escape
]
},
true
,
true
,
C
ONTEXT_PARAMETER_HINTS_VISIBLE
,
C
ontext
.
Visible
,
handler
(
c
=>
c
.
closeWidget
())
handler
(
c
=>
c
.
closeWidget
())
);
);
...
@@ -120,7 +107,7 @@ CommonEditorRegistry.registerEditorCommand(
...
@@ -120,7 +107,7 @@ CommonEditorRegistry.registerEditorCommand(
weight
,
weight
,
{
primary
:
KeyCode
.
UpArrow
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
UpArrow
]
},
{
primary
:
KeyCode
.
UpArrow
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
UpArrow
]
},
true
,
true
,
C
ONTEXT_PARAMETER_HINTS_VISIBLE
,
C
ontext
.
Visible
,
handler
(
c
=>
c
.
showPrevHint
())
handler
(
c
=>
c
.
showPrevHint
())
);
);
...
@@ -129,6 +116,6 @@ CommonEditorRegistry.registerEditorCommand(
...
@@ -129,6 +116,6 @@ CommonEditorRegistry.registerEditorCommand(
weight
,
weight
,
{
primary
:
KeyCode
.
DownArrow
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
DownArrow
]
},
{
primary
:
KeyCode
.
DownArrow
,
secondary
:
[
KeyMod
.
Alt
|
KeyCode
.
DownArrow
]
},
true
,
true
,
C
ONTEXT_PARAMETER_HINTS_VISIBLE
,
C
ontext
.
Visible
,
handler
(
c
=>
c
.
showNextHint
())
handler
(
c
=>
c
.
showNextHint
())
);
);
src/vs/editor/contrib/parameterHints/browser/parameterHintsModel.ts
已删除
100644 → 0
浏览文件 @
ea75c05c
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IDisposable
,
dispose
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ICommonCodeEditor
,
ICursorSelectionChangedEvent
}
from
'
vs/editor/common/editorCommon
'
;
import
{
SignatureHelpProviderRegistry
,
SignatureHelp
}
from
'
vs/editor/common/modes
'
;
import
{
provideSignatureHelp
}
from
'
../common/parameterHints
'
;
export
interface
IHintEvent
{
hints
:
SignatureHelp
;
}
export
class
ParameterHintsModel
extends
Disposable
{
static
DELAY
=
120
;
// ms
private
_onHint
=
this
.
_register
(
new
Emitter
<
IHintEvent
>
());
onHint
:
Event
<
IHintEvent
>
=
this
.
_onHint
.
event
;
private
_onCancel
=
this
.
_register
(
new
Emitter
<
void
>
());
onCancel
:
Event
<
void
>
=
this
.
_onCancel
.
event
;
private
editor
:
ICommonCodeEditor
;
private
triggerCharactersListeners
:
IDisposable
[];
private
active
:
boolean
;
private
throttledDelayer
:
RunOnceScheduler
;
constructor
(
editor
:
ICommonCodeEditor
)
{
super
();
this
.
editor
=
editor
;
this
.
triggerCharactersListeners
=
[];
this
.
throttledDelayer
=
new
RunOnceScheduler
(()
=>
this
.
doTrigger
(),
ParameterHintsModel
.
DELAY
);
this
.
active
=
false
;
this
.
_register
(
this
.
editor
.
onDidChangeModel
(
e
=>
this
.
onModelChanged
()));
this
.
_register
(
this
.
editor
.
onDidChangeModelMode
(
_
=>
this
.
onModelChanged
()));
this
.
_register
(
this
.
editor
.
onDidChangeCursorSelection
(
e
=>
this
.
onCursorChange
(
e
)));
this
.
_register
(
SignatureHelpProviderRegistry
.
onDidChange
(
this
.
onModelChanged
,
this
));
this
.
onModelChanged
();
}
cancel
(
silent
:
boolean
=
false
):
void
{
this
.
active
=
false
;
this
.
throttledDelayer
.
cancel
();
if
(
!
silent
)
{
this
.
_onCancel
.
fire
(
void
0
);
}
}
trigger
(
delay
=
ParameterHintsModel
.
DELAY
):
void
{
if
(
!
SignatureHelpProviderRegistry
.
has
(
this
.
editor
.
getModel
()))
{
return
;
}
this
.
cancel
(
true
);
return
this
.
throttledDelayer
.
schedule
(
delay
);
}
private
doTrigger
():
void
{
provideSignatureHelp
(
this
.
editor
.
getModel
(),
this
.
editor
.
getPosition
())
.
then
<
SignatureHelp
>
(
null
,
onUnexpectedError
)
.
then
(
result
=>
{
if
(
!
result
||
result
.
signatures
.
length
===
0
)
{
this
.
cancel
();
this
.
_onCancel
.
fire
(
void
0
);
return
false
;
}
this
.
active
=
true
;
const
event
:
IHintEvent
=
{
hints
:
result
};
this
.
_onHint
.
fire
(
event
);
return
true
;
});
}
isTriggered
():
boolean
{
return
this
.
active
||
this
.
throttledDelayer
.
isScheduled
();
}
private
onModelChanged
():
void
{
if
(
this
.
active
)
{
this
.
cancel
();
}
this
.
triggerCharactersListeners
=
dispose
(
this
.
triggerCharactersListeners
);
const
model
=
this
.
editor
.
getModel
();
if
(
!
model
)
{
return
;
}
const
support
=
SignatureHelpProviderRegistry
.
ordered
(
model
)[
0
];
if
(
!
support
)
{
return
;
}
this
.
triggerCharactersListeners
=
support
.
signatureHelpTriggerCharacters
.
map
((
ch
)
=>
{
return
this
.
editor
.
addTypingListener
(
ch
,
()
=>
{
this
.
trigger
();
});
});
}
private
onCursorChange
(
e
:
ICursorSelectionChangedEvent
):
void
{
if
(
e
.
source
===
'
mouse
'
)
{
this
.
cancel
();
}
else
if
(
this
.
isTriggered
())
{
this
.
trigger
();
}
}
dispose
():
void
{
this
.
cancel
(
true
);
this
.
triggerCharactersListeners
=
dispose
(
this
.
triggerCharactersListeners
);
super
.
dispose
();
}
}
src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.ts
浏览文件 @
f3993616
...
@@ -7,27 +7,148 @@
...
@@ -7,27 +7,148 @@
import
'
vs/css!./parameterHints
'
;
import
'
vs/css!./parameterHints
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
nls
=
require
(
'
vs/nls
'
);
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
IDisposable
,
dispose
,
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
aria
=
require
(
'
vs/base/browser/ui/aria/aria
'
);
import
aria
=
require
(
'
vs/base/browser/ui/aria/aria
'
);
import
{
SignatureHelp
,
SignatureInformation
}
from
'
vs/editor/common/modes
'
;
import
{
SignatureHelp
,
SignatureInformation
,
SignatureHelpProviderRegistry
}
from
'
vs/editor/common/modes
'
;
import
{
ContentWidgetPositionPreference
,
ICodeEditor
,
IContentWidget
,
IContentWidgetPosition
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
ContentWidgetPositionPreference
,
ICodeEditor
,
IContentWidget
,
IContentWidgetPosition
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
IHintEvent
,
ParameterHintsModel
}
from
'
./parameterHintsModel
'
;
import
{
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
ICommonCodeEditor
,
ICursorSelectionChangedEvent
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IKeybindingContextKey
,
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybindingService
'
;
import
{
Context
,
provideSignatureHelp
}
from
'
../common/parameterHints
'
;
const
$
=
dom
.
emmet
;
const
$
=
dom
.
emmet
;
export
interface
IHintEvent
{
hints
:
SignatureHelp
;
}
export
class
ParameterHintsModel
extends
Disposable
{
static
DELAY
=
120
;
// ms
private
_onHint
=
this
.
_register
(
new
Emitter
<
IHintEvent
>
());
onHint
:
Event
<
IHintEvent
>
=
this
.
_onHint
.
event
;
private
_onCancel
=
this
.
_register
(
new
Emitter
<
void
>
());
onCancel
:
Event
<
void
>
=
this
.
_onCancel
.
event
;
private
editor
:
ICommonCodeEditor
;
private
triggerCharactersListeners
:
IDisposable
[];
private
active
:
boolean
;
private
throttledDelayer
:
RunOnceScheduler
;
constructor
(
editor
:
ICommonCodeEditor
)
{
super
();
this
.
editor
=
editor
;
this
.
triggerCharactersListeners
=
[];
this
.
throttledDelayer
=
new
RunOnceScheduler
(()
=>
this
.
doTrigger
(),
ParameterHintsModel
.
DELAY
);
this
.
active
=
false
;
this
.
_register
(
this
.
editor
.
onDidChangeModel
(
e
=>
this
.
onModelChanged
()));
this
.
_register
(
this
.
editor
.
onDidChangeModelMode
(
_
=>
this
.
onModelChanged
()));
this
.
_register
(
this
.
editor
.
onDidChangeCursorSelection
(
e
=>
this
.
onCursorChange
(
e
)));
this
.
_register
(
SignatureHelpProviderRegistry
.
onDidChange
(
this
.
onModelChanged
,
this
));
this
.
onModelChanged
();
}
cancel
(
silent
:
boolean
=
false
):
void
{
this
.
active
=
false
;
this
.
throttledDelayer
.
cancel
();
if
(
!
silent
)
{
this
.
_onCancel
.
fire
(
void
0
);
}
}
trigger
(
delay
=
ParameterHintsModel
.
DELAY
):
void
{
if
(
!
SignatureHelpProviderRegistry
.
has
(
this
.
editor
.
getModel
()))
{
return
;
}
this
.
cancel
(
true
);
return
this
.
throttledDelayer
.
schedule
(
delay
);
}
private
doTrigger
():
void
{
provideSignatureHelp
(
this
.
editor
.
getModel
(),
this
.
editor
.
getPosition
())
.
then
<
SignatureHelp
>
(
null
,
onUnexpectedError
)
.
then
(
result
=>
{
if
(
!
result
||
result
.
signatures
.
length
===
0
)
{
this
.
cancel
();
this
.
_onCancel
.
fire
(
void
0
);
return
false
;
}
this
.
active
=
true
;
const
event
:
IHintEvent
=
{
hints
:
result
};
this
.
_onHint
.
fire
(
event
);
return
true
;
});
}
isTriggered
():
boolean
{
return
this
.
active
||
this
.
throttledDelayer
.
isScheduled
();
}
private
onModelChanged
():
void
{
if
(
this
.
active
)
{
this
.
cancel
();
}
this
.
triggerCharactersListeners
=
dispose
(
this
.
triggerCharactersListeners
);
const
model
=
this
.
editor
.
getModel
();
if
(
!
model
)
{
return
;
}
const
support
=
SignatureHelpProviderRegistry
.
ordered
(
model
)[
0
];
if
(
!
support
)
{
return
;
}
this
.
triggerCharactersListeners
=
support
.
signatureHelpTriggerCharacters
.
map
((
ch
)
=>
{
return
this
.
editor
.
addTypingListener
(
ch
,
()
=>
{
this
.
trigger
();
});
});
}
private
onCursorChange
(
e
:
ICursorSelectionChangedEvent
):
void
{
if
(
e
.
source
===
'
mouse
'
)
{
this
.
cancel
();
}
else
if
(
this
.
isTriggered
())
{
this
.
trigger
();
}
}
dispose
():
void
{
this
.
cancel
(
true
);
this
.
triggerCharactersListeners
=
dispose
(
this
.
triggerCharactersListeners
);
super
.
dispose
();
}
}
interface
ISignatureView
{
interface
ISignatureView
{
top
:
number
;
top
:
number
;
height
:
number
;
height
:
number
;
}
}
export
class
ParameterHintsWidget
implements
IContentWidget
{
export
class
ParameterHintsWidget
implements
IContentWidget
,
IDisposable
{
static
ID
=
'
editor.widget.parameterHintsWidget
'
;
static
ID
=
'
editor.widget.parameterHintsWidget
'
;
private
editor
:
ICodeEditor
;
private
model
:
ParameterHintsModel
;
private
model
:
ParameterHintsModel
;
private
parameterHintsVisible
:
IKeybindingContextKey
<
boolean
>
;
private
element
:
HTMLElement
;
private
element
:
HTMLElement
;
private
signatures
:
HTMLElement
;
private
signatures
:
HTMLElement
;
private
overloads
:
HTMLElement
;
private
overloads
:
HTMLElement
;
...
@@ -38,20 +159,13 @@ export class ParameterHintsWidget implements IContentWidget {
...
@@ -38,20 +159,13 @@ export class ParameterHintsWidget implements IContentWidget {
private
announcedLabel
:
string
;
private
announcedLabel
:
string
;
private
disposables
:
IDisposable
[];
private
disposables
:
IDisposable
[];
private
_onShown
:
()
=>
void
;
private
_onHidden
:
()
=>
void
;
// Editor.IContentWidget.allowEditorOverflow
// Editor.IContentWidget.allowEditorOverflow
allowEditorOverflow
=
true
;
allowEditorOverflow
=
true
;
constructor
(
model
:
ParameterHintsModel
,
editor
:
ICodeEditor
,
onShown
:
()
=>
void
,
onHidden
:
()
=>
void
)
{
constructor
(
private
editor
:
ICodeEditor
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
this
.
_onShown
=
onShown
;
this
.
model
=
new
ParameterHintsModel
(
editor
);
this
.
_onHidden
=
onHidden
;
this
.
parameterHintsVisible
=
keybindingService
.
createKey
(
Context
.
Visible
,
false
);
this
.
editor
=
editor
;
this
.
model
=
null
;
this
.
visible
=
false
;
this
.
visible
=
false
;
this
.
model
=
model
;
this
.
disposables
=
[];
this
.
disposables
=
[];
this
.
disposables
.
push
(
this
.
model
.
onHint
((
e
:
IHintEvent
)
=>
{
this
.
disposables
.
push
(
this
.
model
.
onHint
((
e
:
IHintEvent
)
=>
{
...
@@ -62,7 +176,9 @@ export class ParameterHintsWidget implements IContentWidget {
...
@@ -62,7 +176,9 @@ export class ParameterHintsWidget implements IContentWidget {
this
.
select
(
this
.
currentSignature
);
this
.
select
(
this
.
currentSignature
);
}));
}));
this
.
disposables
.
push
(
this
.
model
.
onCancel
(()
=>
this
.
hide
()));
this
.
disposables
.
push
(
this
.
model
.
onCancel
(()
=>
{
this
.
hide
();
}));
this
.
element
=
$
(
'
.editor-widget.parameter-hints-widget
'
);
this
.
element
=
$
(
'
.editor-widget.parameter-hints-widget
'
);
...
@@ -109,7 +225,7 @@ export class ParameterHintsWidget implements IContentWidget {
...
@@ -109,7 +225,7 @@ export class ParameterHintsWidget implements IContentWidget {
return
;
return
;
}
}
this
.
_onShown
(
);
this
.
parameterHintsVisible
.
set
(
true
);
this
.
visible
=
true
;
this
.
visible
=
true
;
TPromise
.
timeout
(
100
).
done
(()
=>
dom
.
addClass
(
this
.
element
,
'
visible
'
));
TPromise
.
timeout
(
100
).
done
(()
=>
dom
.
addClass
(
this
.
element
,
'
visible
'
));
this
.
editor
.
layoutContentWidget
(
this
);
this
.
editor
.
layoutContentWidget
(
this
);
...
@@ -120,7 +236,7 @@ export class ParameterHintsWidget implements IContentWidget {
...
@@ -120,7 +236,7 @@ export class ParameterHintsWidget implements IContentWidget {
return
;
return
;
}
}
this
.
_onHidden
();
this
.
parameterHintsVisible
.
reset
();
this
.
visible
=
false
;
this
.
visible
=
false
;
this
.
parameterHints
=
null
;
this
.
parameterHints
=
null
;
this
.
announcedLabel
=
null
;
this
.
announcedLabel
=
null
;
...
@@ -318,7 +434,11 @@ export class ParameterHintsWidget implements IContentWidget {
...
@@ -318,7 +434,11 @@ export class ParameterHintsWidget implements IContentWidget {
return
ParameterHintsWidget
.
ID
;
return
ParameterHintsWidget
.
ID
;
}
}
destroy
():
void
{
trigger
():
void
{
this
.
model
.
trigger
(
0
);
}
dispose
():
void
{
this
.
disposables
=
dispose
(
this
.
disposables
);
this
.
disposables
=
dispose
(
this
.
disposables
);
this
.
model
=
null
;
this
.
model
=
null
;
}
}
...
...
src/vs/editor/contrib/parameterHints/common/parameterHints.ts
浏览文件 @
f3993616
...
@@ -12,6 +12,10 @@ import { SignatureHelp, SignatureHelpProviderRegistry } from 'vs/editor/common/m
...
@@ -12,6 +12,10 @@ import { SignatureHelp, SignatureHelpProviderRegistry } from 'vs/editor/common/m
import
{
asWinJsPromise
}
from
'
vs/base/common/async
'
;
import
{
asWinJsPromise
}
from
'
vs/base/common/async
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
import
{
Position
}
from
'
vs/editor/common/core/position
'
;
export
const
Context
=
{
Visible
:
'
parameterHintsVisible
'
};
export
function
provideSignatureHelp
(
model
:
IReadOnlyModel
,
position
:
Position
):
TPromise
<
SignatureHelp
>
{
export
function
provideSignatureHelp
(
model
:
IReadOnlyModel
,
position
:
Position
):
TPromise
<
SignatureHelp
>
{
const
support
=
SignatureHelpProviderRegistry
.
ordered
(
model
)[
0
];
const
support
=
SignatureHelpProviderRegistry
.
ordered
(
model
)[
0
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录