Skip to content

Commit 6e994dc

Browse files
committed
fix: ensure server is installed before restarting
previously, restarting the server after uninstalling `simplicityhl-lsp` caused an error, because the extension attempted to launch a missing executable. this change ensures that server is checking that this executable is present and install otherwise.
1 parent 9203a40 commit 6e994dc

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

vscode/src/client.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ export class LspClient {
5353
}
5454
}
5555

56-
public stop(): Thenable<void> | undefined {
56+
public async stop(): Promise<void> {
5757
if (!this.client) {
58-
return undefined;
58+
return;
5959
}
60-
return this.client.stop();
60+
await this.client.stop();
61+
this.client = undefined;
6162
}
6263

6364
public async restart(): Promise<void> {
@@ -67,8 +68,8 @@ export class LspClient {
6768
}
6869

6970
try {
70-
await this.client.stop();
71-
await this.client.start();
71+
await this.stop();
72+
await this.start();
7273
window.showInformationMessage("SimplicityHL Language Server restarted successfully!");
7374
} catch (e) {
7475
window.showErrorMessage(`Failed to restart LSP: ${e}`);

0 commit comments

Comments
 (0)