Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 943d67e

Browse filesBrowse files
committed
Do proper clean-up of tmp directories
1 parent bdef5c2 commit 943d67e
Copy full SHA for 943d67e

File tree

2 files changed

+7
-15
lines changed
Filter options

2 files changed

+7
-15
lines changed

‎ls/ls.go

Copy file name to clipboardExpand all lines: ls/ls.go
+7-14Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -977,8 +977,8 @@ func (ls *INOLanguageServer) initializedNotifFromIDE(logger jsonrpc.FunctionLogg
977977

978978
func (ls *INOLanguageServer) exitNotifFromIDE(logger jsonrpc.FunctionLogger) {
979979
ls.Clangd.conn.Exit()
980-
logger.Logf("Arduino Language Server is shutting down.")
981-
os.Exit(0)
980+
logger.Logf("Arduino Language Server is exiting.")
981+
ls.Close()
982982
}
983983

984984
func (ls *INOLanguageServer) textDocumentDidOpenNotifFromIDE(logger jsonrpc.FunctionLogger, ideParam *lsp.DidOpenTextDocumentParams) {
@@ -1381,18 +1381,6 @@ func (ls *INOLanguageServer) Close() {
13811381
close(ls.closing)
13821382
ls.closing = nil
13831383
}
1384-
if ls.buildPath != nil {
1385-
ls.buildPath.RemoveAll()
1386-
}
1387-
}
1388-
1389-
// CloseNotify returns a channel that is closed when the InoHandler is closed
1390-
func (ls *INOLanguageServer) CloseNotify() <-chan bool {
1391-
return ls.closing
1392-
}
1393-
1394-
// CleanUp performs cleanup of the workspace and temp files create by the language server
1395-
func (ls *INOLanguageServer) CleanUp() {
13961384
if ls.buildPath != nil {
13971385
ls.buildPath.RemoveAll()
13981386
ls.buildPath = nil
@@ -1403,6 +1391,11 @@ func (ls *INOLanguageServer) CleanUp() {
14031391
}
14041392
}
14051393

1394+
// CloseNotify returns a channel that is closed when the InoHandler is closed
1395+
func (ls *INOLanguageServer) CloseNotify() <-chan bool {
1396+
return ls.closing
1397+
}
1398+
14061399
func (ls *INOLanguageServer) extractDataFolderFromArduinoCLI(logger jsonrpc.FunctionLogger) (*paths.Path, error) {
14071400
var dataDir string
14081401
if ls.config.CliPath == nil {

‎main.go

Copy file name to clipboardExpand all lines: main.go
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,5 @@ https://microsoft.github.io/language-server-protocol/
155155
case <-c:
156156
log.Println("INTERRUPTED")
157157
}
158-
inoHandler.CleanUp()
159158
inoHandler.Close()
160159
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.