diff --git a/extension/lsp/lsp.ts b/extension/lsp/lsp.ts index 5c11f4f..7dcb31d 100644 --- a/extension/lsp/lsp.ts +++ b/extension/lsp/lsp.ts @@ -86,6 +86,14 @@ export class MojoLSPManager extends DisposableContext { }), ); + this.pushSubscription( + vscode.commands.registerCommand('mojo.lsp.stop', async () => { + if (this.lspClient) { + await this.lspClient.stop(); + } + }), + ); + if ( this.extensionContext.extensionMode == vscode.ExtensionMode.Development || this.extensionContext.extensionMode == vscode.ExtensionMode.Test @@ -345,8 +353,7 @@ export class MojoLSPManager extends DisposableContext { ); this.logger.lsp.info( - `Launching Language Server '${ - initializationOptions.serverPath + `Launching Language Server '${initializationOptions.serverPath }' with options:`, initializationOptions.serverArgs, ); diff --git a/package.json b/package.json index dbad5c9..b44c4c0 100644 --- a/package.json +++ b/package.json @@ -178,6 +178,11 @@ "command": "mojo.lsp.restart", "title": "Restart the Mojo LSP Server" }, + { + "category": "Developer", + "command": "mojo.lsp.stop", + "title": "Stop the Mojo LSP Server" + }, { "category": "Mojo", "command": "mojo.lsp.startRecord",