File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Expand file tree Collapse file tree 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> {
427427
428428 apiManager . getApiInstance ( ) . onDidServerModeChange ( ( event : ServerMode ) => {
429429 if ( event === ServerMode . STANDARD ) {
430- syntaxClient . stop ( ) ;
430+ syntaxClient . getClient ( ) . stop ( ) . then ( client => {
431+ syntaxClient . stop ( ) ;
432+ } ) ;
431433 fileEventHandler . setServerStatus ( true ) ;
432434 runtimeStatusBarProvider . initialize ( context ) ;
433435 }
@@ -633,9 +635,16 @@ export function getJavaConfig(javaHome: string) {
633635 return javaConfig ;
634636}
635637
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+ } ) ;
639648}
640649
641650export async function getActiveLanguageClient ( ) : Promise < LanguageClient | undefined > {
Original file line number Diff line number Diff line change @@ -520,7 +520,6 @@ export class StandardLanguageClient {
520520
521521 public stop ( ) {
522522 if ( this . languageClient ) {
523- this . languageClient . stop ( ) ;
524523 this . status = ClientStatus . Stopping ;
525524 }
526525 }
Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ export class SyntaxLanguageClient {
9292 public stop ( ) {
9393 this . status = ClientStatus . Stopping ;
9494 if ( this . languageClient ) {
95- this . languageClient . stop ( ) ;
9695 this . languageClient = null ;
9796 }
9897 }
You can’t perform that action at this time.
0 commit comments