File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -535,14 +535,15 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
535535 }
536536
537537 const languageServerExt = languageServer ( ) ;
538+ const noLSsubscriptions : { dispose ( ) : any } [ ] = [ ] ;
538539 if ( ! languageServerExt ) {
539540 outputChannel . appendLine ( `The language-server extension was not found.\n` ) ;
540541 outputChannel . show ( true ) ;
541542
542543 if ( vscode . window . activeTextEditor ) {
543544 diagnosticProvider . updateDiagnostics ( vscode . window . activeTextEditor . document ) ;
544545 }
545- context . subscriptions . push (
546+ noLSsubscriptions . push (
546547 workspace . onDidChangeTextDocument ( ( event ) => {
547548 diagnosticProvider . updateDiagnostics ( event . document ) ;
548549 } ) ,
@@ -576,10 +577,19 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
576577 "#"
577578 )
578579 ) ;
580+ context . subscriptions . push ( ...noLSsubscriptions ) ;
579581 }
580582
581583 context . subscriptions . push (
582584 reporter ,
585+ vscode . extensions . onDidChange ( ( ) => {
586+ const languageServerExt2 = languageServer ( ) ;
587+ if ( typeof languageServerExt !== typeof languageServerExt2 ) {
588+ noLSsubscriptions . forEach ( ( event ) => {
589+ event . dispose ( ) ;
590+ } ) ;
591+ }
592+ } ) ,
583593 workspace . onDidChangeTextDocument ( ( event ) => {
584594 if (
585595 event . contentChanges . length !== 0 &&
You can’t perform that action at this time.
0 commit comments