Skip to content

Commit 71aa31d

Browse files
committed
stop server when deactivated
1 parent 9356c29 commit 71aa31d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/extension.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export function activate(context: vscode.ExtensionContext) {
3434

3535
// this method is called when your extension is deactivated
3636
export function deactivate() {
37+
stopServer();
3738
}
3839

3940
function startClient() {
@@ -71,7 +72,7 @@ function startClient() {
7172
return Promise.resolve(result);
7273
};
7374
} else {
74-
let cp = path.resolve(savedContext.extensionPath, "../EmmyLua-LanguageServer/EmmyLua-PSI/build/libs", "*");
75+
let cp = path.resolve(savedContext.extensionPath, "res/jar", "*");
7576
serverOptions = {
7677
command: "java",
7778
args: ["-cp", cp, "com.tang.vscode.vscode.MainKt"]
@@ -115,4 +116,10 @@ function restartServer() {
115116
startClient();
116117
});
117118
}
119+
}
120+
121+
function stopServer() {
122+
if (client) {
123+
client.stop();
124+
}
118125
}

0 commit comments

Comments
 (0)