Skip to content

Commit b45ed8c

Browse files
committed
Await language server shutdown on deactivate (#58)
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
1 parent 337344d commit b45ed8c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/extension.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ function restartLanguageServer() {
142142
);
143143
}
144144

145-
function stopLanguageServer() {
145+
function stopLanguageServer(): Thenable<void> | undefined {
146146
if (!languageClient) {
147-
return;
147+
return undefined;
148148
}
149-
languageClient.stop();
149+
return languageClient.stop();
150150
}
151151

152152
function onDidChangeConfiguration(event: vscode.ConfigurationChangeEvent) {
@@ -174,7 +174,6 @@ export function activate(context: vscode.ExtensionContext) {
174174
startLanguageServer();
175175
}
176176

177-
export function deactivate() {
178-
stopLanguageServer();
179-
extensionContext = null;
177+
export function deactivate(): Thenable<void> | undefined {
178+
return stopLanguageServer();
180179
}

0 commit comments

Comments
 (0)