55
66import * as nls from 'vs/nls' ;
77import { KeyCode , KeyMod } from 'vs/base/common/keyCodes' ;
8- import { dispose } from 'vs/base/common/lifecycle' ;
8+ import { Disposable } from 'vs/base/common/lifecycle' ;
99import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
1010import { IEditorContribution } from 'vs/editor/common/editorCommon' ;
1111import { EditorContextKeys } from 'vs/editor/common/editorContextKeys' ;
@@ -18,7 +18,7 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis
1818import * as modes from 'vs/editor/common/modes' ;
1919import { TriggerContext } from 'vs/editor/contrib/parameterHints/parameterHintsModel' ;
2020
21- class ParameterHintsController implements IEditorContribution {
21+ class ParameterHintsController extends Disposable implements IEditorContribution {
2222
2323 private static readonly ID = 'editor.controller.parameterHints' ;
2424
@@ -30,8 +30,9 @@ class ParameterHintsController implements IEditorContribution {
3030 private readonly widget : ParameterHintsWidget ;
3131
3232 constructor ( editor : ICodeEditor , @IInstantiationService instantiationService : IInstantiationService ) {
33+ super ( ) ;
3334 this . editor = editor ;
34- this . widget = instantiationService . createInstance ( ParameterHintsWidget , this . editor ) ;
35+ this . widget = this . _register ( instantiationService . createInstance ( ParameterHintsWidget , this . editor ) ) ;
3536 }
3637
3738 getId ( ) : string {
@@ -53,10 +54,6 @@ class ParameterHintsController implements IEditorContribution {
5354 trigger ( context : TriggerContext ) : void {
5455 this . widget . trigger ( context ) ;
5556 }
56-
57- dispose ( ) : void {
58- dispose ( this . widget ) ;
59- }
6057}
6158
6259export class TriggerParameterHintsAction extends EditorAction {
@@ -76,7 +73,7 @@ export class TriggerParameterHintsAction extends EditorAction {
7673 }
7774
7875 public run ( accessor : ServicesAccessor , editor : ICodeEditor ) : void {
79- let controller = ParameterHintsController . get ( editor ) ;
76+ const controller = ParameterHintsController . get ( editor ) ;
8077 if ( controller ) {
8178 controller . trigger ( {
8279 triggerKind : modes . SignatureHelpTriggerKind . Invoke
0 commit comments