File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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" ,
You can’t perform that action at this time.
0 commit comments