File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 6565 "command" : " squawk.stopServer" ,
6666 "title" : " Stop Server" ,
6767 "category" : " Squawk"
68+ },
69+ {
70+ "command" : " squawk.restartServer" ,
71+ "title" : " Restart Server" ,
72+ "category" : " Squawk"
6873 }
6974 ],
7075 "languages" : [
Original file line number Diff line number Diff line change @@ -144,6 +144,12 @@ export async function activate(context: vscode.ExtensionContext) {
144144 } ) ,
145145 )
146146
147+ context . subscriptions . push (
148+ vscode . commands . registerCommand ( "squawk.restartServer" , async ( ) => {
149+ await restartServer ( context )
150+ } ) ,
151+ )
152+
147153 context . subscriptions . push ( onClientStateChange )
148154
149155 await startServer ( context )
@@ -311,6 +317,12 @@ async function stopServer() {
311317 log . info ( "server stopped" )
312318}
313319
320+ async function restartServer ( context : vscode . ExtensionContext ) {
321+ log . info ( "restart server" )
322+ await stopServer ( )
323+ await startServer ( context )
324+ }
325+
314326// Based on rust-analyzer's SyntaxTree support:
315327// https://github.com/rust-lang/rust-analyzer/blob/c0eaff7dd1fdfffed4e5706780e79967760d1d9b/editors/code/src/commands.ts#L432-L510
316328class SyntaxTreeProvider implements vscode . TextDocumentContentProvider {
You can’t perform that action at this time.
0 commit comments