File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 323323 "command" : " haskell.commands.restartServer" ,
324324 "title" : " Haskell: Restart Haskell LSP server" ,
325325 "description" : " Restart the Haskell LSP server"
326+ },
327+ {
328+ "command" : " haskell.commands.startServer" ,
329+ "title" : " Haskell: Start Haskell LSP server" ,
330+ "description" : " Start the Haskell LSP server"
331+ },
332+ {
333+ "command" : " haskell.commands.stopServer" ,
334+ "title" : " Haskell: Stop Haskell LSP server" ,
335+ "description" : " Stop the Haskell LSP server"
326336 }
327337 ]
328338 },
Original file line number Diff line number Diff line change 11export namespace CommandNames {
22 export const ImportIdentifierCommandName = 'haskell.commands.importIdentifier' ;
33 export const RestartServerCommandName = 'haskell.commands.restartServer' ;
4+ export const StartServerCommandName = 'haskell.commands.startServer' ;
5+ export const StopServerCommandName = 'haskell.commands.stopServer' ;
46}
Original file line number Diff line number Diff line change @@ -68,6 +68,26 @@ export async function activate(context: ExtensionContext) {
6868
6969 context . subscriptions . push ( restartCmd ) ;
7070
71+ const stopCmd = commands . registerCommand ( CommandNames . StopServerCommandName , async ( ) => {
72+ for ( const langClient of clients . values ( ) ) {
73+ langClient ?. info ( 'Stopping the client' ) ;
74+ await langClient ?. stop ( ) ;
75+ langClient ?. info ( 'Client stopped' ) ;
76+ }
77+ } ) ;
78+
79+ context . subscriptions . push ( stopCmd ) ;
80+
81+ const startCmd = commands . registerCommand ( CommandNames . StartServerCommandName , async ( ) => {
82+ for ( const langClient of clients . values ( ) ) {
83+ langClient ?. info ( 'Starting the client' ) ;
84+ langClient ?. start ( ) ;
85+ langClient ?. info ( 'Client started' ) ;
86+ }
87+ } ) ;
88+
89+ context . subscriptions . push ( startCmd ) ;
90+
7191 context . subscriptions . push ( ImportIdentifier . registerCommand ( ) ) ;
7292
7393 // Set up the documentation browser.
You can’t perform that action at this time.
0 commit comments