Skip to content

Commit 19644c0

Browse files
authored
Merge branch 'main' into fix-changelog-26-1-0
2 parents 450248b + f98c1ea commit 19644c0

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

extension/lsp/lsp.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,16 @@ export class MojoLSPManager extends DisposableContext {
8686
}),
8787
);
8888

89+
this.pushSubscription(
90+
vscode.commands.registerCommand('mojo.lsp.stop', async () => {
91+
if (this.lspClient) {
92+
await this.lspClient.stop();
93+
// We do not set lspClient to undefined, as this would trigger
94+
// restarting the client when a new mojo file is opened.
95+
}
96+
}),
97+
);
98+
8999
if (
90100
this.extensionContext.extensionMode == vscode.ExtensionMode.Development ||
91101
this.extensionContext.extensionMode == vscode.ExtensionMode.Test

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@
184184
"command": "mojo.lsp.restart",
185185
"title": "Restart the Mojo LSP Server"
186186
},
187+
{
188+
"category": "Developer",
189+
"command": "mojo.lsp.stop",
190+
"title": "Stop the Mojo LSP Server"
191+
},
187192
{
188193
"category": "Mojo",
189194
"command": "mojo.lsp.startRecord",

0 commit comments

Comments
 (0)