Skip to content

Commit

Permalink
Fix restart LSP reloads settings.json
Browse files Browse the repository at this point in the history
  • Loading branch information
VonTum committed Jan 21, 2025
1 parent 904c8fd commit 5548783
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion client/out/extension.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/out/extension.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ function start_lsp() {
export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(vscode.commands.registerCommand("sus.restartServer", async () => {
if (client) {
client.restart();
// Don't use client.restart(), because we want to reload the settings
return client.stop().then(() => {
client.dispose().then(() => {
client = undefined;
start_lsp();
});
});
} else {
start_lsp();
}
Expand Down

0 comments on commit 5548783

Please sign in to comment.