Skip to content

Commit

Permalink
Potential fix for crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
VonTum committed Dec 2, 2024
1 parent 7dfbbba commit 61bbb3f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 39 deletions.
12 changes: 0 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@
"type": "npm",
"script": "watch"
}
},
{
"name": "Language Server E2E Test",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/client/out/test/index",
"${workspaceRoot}/client/testFixture"
],
"outFiles": ["${workspaceRoot}/client/out/test/**/*.js"]
}
]
}
22 changes: 10 additions & 12 deletions 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.

22 changes: 9 additions & 13 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,28 +86,24 @@ function start_lsp() {
client.start();
}

function stop_lsp() {
if (!client) {
return undefined;
}
return client.stop();
}

export function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(vscode.commands.registerCommand("sus.restartServer", async () => {
if (client) {
await client.stop();
client = undefined;
client.restart();
} else {
start_lsp();
}
start_lsp();
}));

start_lsp();
}

export function deactivate(): Thenable<void> | undefined {
if (!client) {
return undefined;
if (client) {
return client.stop().then(() => {
client.dispose().then(() => {
client = undefined;
});
});
}
return client.stop();
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"icon": "susLogo512.png",
"author": "Lennart Van Hirtum <[email protected]>",
"license": "MIT",
"version": "0.1.0",
"version": "0.1.1",
"repository": {
"type": "git",
"url": "https://github.com/pc2/sus-lsp"
Expand Down

0 comments on commit 61bbb3f

Please sign in to comment.