Skip to content

Commit

Permalink
Kill language server zombie processes
Browse files Browse the repository at this point in the history
We just need to await from my testing.
  • Loading branch information
tristan957 committed Nov 14, 2023
1 parent 68f18fb commit a374616
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## next

- Kill language server zombie processes

## 1.16.3

- Bump Swift-MesonLSP to v3.1.1
Expand Down
2 changes: 1 addition & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export async function activate(ctx: vscode.ExtensionContext) {
// TODO: The output line from above about not enabling muon would be good to have here.
}
} else {
client.restart();
await client.restart();
await client.reloadConfig();
}
}),
Expand Down
10 changes: 5 additions & 5 deletions src/lsp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ export abstract class LanguageServerClient {
return null;
}

dispose() {
async dispose(): Promise<void> {
if (this.ls !== null) {
this.ls.stop();
await this.ls.stop();
this.ls = null;
}
}

restart(): void {
this.dispose();
async restart(): Promise<void> {
await this.dispose();
this.languageServerPath = LanguageServerClient.resolveLanguageServerPath(this.server, this.context);
if (this.languageServerPath === null) {
vscode.window.showErrorMessage(
Expand Down Expand Up @@ -224,6 +224,6 @@ export abstract class LanguageServerClient {
vscode.window.showInformationMessage(`Updating language server to ${this.referenceVersion}`);
this.dispose();
await serverToClass(this.server).download(this.server, this.referenceVersion, context);
this.restart();
await this.restart();
}
}

0 comments on commit a374616

Please sign in to comment.