Skip to content

Commit 8e94fe0

Browse files
authored
Merge pull request #1344 from sadan4/fix/dispose-client
fix: properly dispose of the client
2 parents d531143 + 295659e commit 8e94fe0

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

vscode-client/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Bash IDE
22

3+
## 1.43.1
4+
- Properly dispose client.
5+
36
## 1.43.0
47
- Upgrade language server to 5.4.2 (treesitter upgrade).
58

vscode-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "A language server for Bash",
55
"author": "Mads Hartmann",
66
"license": "MIT",
7-
"version": "1.43.0",
7+
"version": "1.43.1",
88
"publisher": "mads-hartmann",
99
"repository": {
1010
"type": "git",

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)