File tree 3 files changed +13
-6
lines changed 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -427,7 +427,9 @@ export function activate(context: ExtensionContext): Promise<ExtensionAPI> {
427
427
428
428
apiManager . getApiInstance ( ) . onDidServerModeChange ( ( event : ServerMode ) => {
429
429
if ( event === ServerMode . STANDARD ) {
430
- syntaxClient . stop ( ) ;
430
+ syntaxClient . getClient ( ) . stop ( ) . then ( client => {
431
+ syntaxClient . stop ( ) ;
432
+ } ) ;
431
433
fileEventHandler . setServerStatus ( true ) ;
432
434
runtimeStatusBarProvider . initialize ( context ) ;
433
435
}
@@ -633,9 +635,16 @@ export function getJavaConfig(javaHome: string) {
633
635
return javaConfig ;
634
636
}
635
637
636
- export function deactivate ( ) : void {
637
- standardClient . stop ( ) ;
638
- syntaxClient . stop ( ) ;
638
+ export function deactivate ( ) : Promise < void > {
639
+ return getActiveLanguageClient ( ) . then ( client => {
640
+ standardClient . stop ( ) ;
641
+ syntaxClient . stop ( ) ;
642
+ if ( ! client ) {
643
+ return undefined ;
644
+ } else {
645
+ return client . stop ( ) ;
646
+ }
647
+ } ) ;
639
648
}
640
649
641
650
export async function getActiveLanguageClient ( ) : Promise < LanguageClient | undefined > {
Original file line number Diff line number Diff line change @@ -520,7 +520,6 @@ export class StandardLanguageClient {
520
520
521
521
public stop ( ) {
522
522
if ( this . languageClient ) {
523
- this . languageClient . stop ( ) ;
524
523
this . status = ClientStatus . Stopping ;
525
524
}
526
525
}
Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ export class SyntaxLanguageClient {
92
92
public stop ( ) {
93
93
this . status = ClientStatus . Stopping ;
94
94
if ( this . languageClient ) {
95
- this . languageClient . stop ( ) ;
96
95
this . languageClient = null ;
97
96
}
98
97
}
You can’t perform that action at this time.
0 commit comments