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> {
535
535
}
536
536
537
537
const languageServerExt = languageServer ( ) ;
538
+ const noLSsubscriptions : { dispose ( ) : any } [ ] = [ ] ;
538
539
if ( ! languageServerExt ) {
539
540
outputChannel . appendLine ( `The language-server extension was not found.\n` ) ;
540
541
outputChannel . show ( true ) ;
541
542
542
543
if ( vscode . window . activeTextEditor ) {
543
544
diagnosticProvider . updateDiagnostics ( vscode . window . activeTextEditor . document ) ;
544
545
}
545
- context . subscriptions . push (
546
+ noLSsubscriptions . push (
546
547
workspace . onDidChangeTextDocument ( ( event ) => {
547
548
diagnosticProvider . updateDiagnostics ( event . document ) ;
548
549
} ) ,
@@ -576,10 +577,19 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
576
577
"#"
577
578
)
578
579
) ;
580
+ context . subscriptions . push ( ...noLSsubscriptions ) ;
579
581
}
580
582
581
583
context . subscriptions . push (
582
584
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
+ } ) ,
583
593
workspace . onDidChangeTextDocument ( ( event ) => {
584
594
if (
585
595
event . contentChanges . length !== 0 &&
You can’t perform that action at this time.
0 commit comments