Skip to content

Commit a2942cd

Browse files
committed
Correctly handle shutdown
1 parent 8291147 commit a2942cd

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: ls/ls.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,7 @@ func (ls *INOLanguageServer) InitializeReqFromIDE(ctx context.Context, logger js
297297
}
298298

299299
func (ls *INOLanguageServer) ShutdownReqFromIDE(ctx context.Context, logger jsonrpc.FunctionLogger) *jsonrpc.ResponseError {
300-
logger.Logf("Sending shutdown notification to clangd...")
301300
ls.Clangd.conn.Shutdown(context.Background())
302-
logger.Logf("Arduino Language Server is shutting down.")
303-
ls.Close()
304301
return nil
305302
}
306303

@@ -812,7 +809,9 @@ func (ls *INOLanguageServer) InitializedNotifFromIDE(logger jsonrpc.FunctionLogg
812809
}
813810

814811
func (ls *INOLanguageServer) ExitNotifFromIDE(logger jsonrpc.FunctionLogger) {
815-
logger.Logf("Notification is not propagated to clangd")
812+
ls.Clangd.conn.Exit()
813+
logger.Logf("Arduino Language Server is shutting down.")
814+
os.Exit(0)
816815
}
817816

818817
func (ls *INOLanguageServer) TextDocumentDidOpenNotifFromIDE(logger jsonrpc.FunctionLogger, inoParam *lsp.DidOpenTextDocumentParams) {

0 commit comments

Comments
 (0)