Skip to content

Commit 181c478

Browse files
committed
fix: properly dispose of the client
this fixes a bug introduced in 119f32a (and somehow not noticed in 6eb243e ????)
1 parent d531143 commit 181c478

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

vscode-client/src/extension.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
TransportKind,
1010
} from 'vscode-languageclient/node'
1111

12-
let client: LanguageClient
12+
let client: LanguageClient | undefined
1313

1414
export const CONFIGURATION_SECTION = 'bashIde' // matching the package.json configuration section
1515

@@ -60,7 +60,7 @@ export async function activate(context: ExtensionContext) {
6060
},
6161
}
6262

63-
const client = new LanguageClient('Bash IDE', 'Bash IDE', serverOptions, clientOptions)
63+
client = new LanguageClient('Bash IDE', 'Bash IDE', serverOptions, clientOptions)
6464
client.registerProposedFeatures()
6565

6666
try {
@@ -71,8 +71,5 @@ export async function activate(context: ExtensionContext) {
7171
}
7272

7373
export function deactivate(): Thenable<void> | undefined {
74-
if (!client) {
75-
return undefined
76-
}
77-
return client.stop()
74+
return client?.stop()
7875
}

0 commit comments

Comments
 (0)