Skip to content

Commit

Permalink
Await language server shutdown on deactivate (#58)
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed Jan 13, 2025
1 parent 337344d commit b45ed8c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ function restartLanguageServer() {
);
}

function stopLanguageServer() {
function stopLanguageServer(): Thenable<void> | undefined {
if (!languageClient) {
return;
return undefined;
}
languageClient.stop();
return languageClient.stop();
}

function onDidChangeConfiguration(event: vscode.ConfigurationChangeEvent) {
Expand Down Expand Up @@ -174,7 +174,6 @@ export function activate(context: vscode.ExtensionContext) {
startLanguageServer();
}

export function deactivate() {
stopLanguageServer();
extensionContext = null;
export function deactivate(): Thenable<void> | undefined {
return stopLanguageServer();
}

0 comments on commit b45ed8c

Please sign in to comment.