File tree Expand file tree Collapse file tree
packages/vscode-typescript/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -314,9 +314,8 @@ export class Client implements vscode.Disposable {
314314 logLevelListener ,
315315 serverTelemetryListener ,
316316 registerSourceDefinitionFeature ( this . client ) ,
317- registerOnAutoInsertFeature ( this . documentSelector , this . client ) ,
318317 ) ;
319- // Register the selector-scoped custom providers (hover, multi-document highlight). These start
318+ // Register the selector-scoped custom providers (hover, multi-document highlight, on-auto-insert ). These start
320319 // scoped to the static jsTs selector and expand as content-mapped extensions register.
321320 this . registerSelectorScopedFeatures ( ) ;
322321 }
@@ -383,6 +382,7 @@ export class Client implements vscode.Disposable {
383382 this . selectorScopedFeatures . push (
384383 registerMultiDocumentHighlightFeature ( selector , this . client ) ,
385384 registerHoverFeature ( selector , this . client ) ,
385+ registerOnAutoInsertFeature ( selector , this . client ) ,
386386 ) ;
387387 }
388388
Original file line number Diff line number Diff line change @@ -3,14 +3,15 @@ import * as vscode from "vscode";
33export class Condition {
44 private _value : boolean ;
55 private isDisposed = false ;
6+ private readonly updateListener : vscode . Disposable ;
67
78 constructor (
89 private readonly getValue : ( ) => boolean ,
9- onUpdate : ( handler : ( ) => void ) => void ,
10+ onUpdate : ( handler : ( ) => void ) => vscode . Disposable ,
1011 ) {
1112 this . _value = this . getValue ( ) ;
1213
13- onUpdate ( ( ) => {
14+ this . updateListener = onUpdate ( ( ) => {
1415 const newValue = this . getValue ( ) ;
1516 if ( newValue !== this . _value ) {
1617 this . _value = newValue ;
@@ -31,6 +32,7 @@ export class Condition {
3132 return ;
3233 }
3334 this . isDisposed = true ;
35+ this . updateListener . dispose ( ) ;
3436 this . _onDidChange . dispose ( ) ;
3537 }
3638}
You can’t perform that action at this time.
0 commit comments