Skip to content

Commit

Permalink
Properly clear nimsuggest context on project close
Browse files Browse the repository at this point in the history
  • Loading branch information
PMunch committed Nov 9, 2023
1 parent 62a2fc7 commit 564190e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/nimlsp.nim
Original file line number Diff line number Diff line change
Expand Up @@ -561,13 +561,12 @@ proc main(ins: Stream | AsyncFile, outs: Stream | AsyncFile) {.multisync.} =
debugLog "Got document close for URI: ", fileuri, " copied to ", filestash
projectFiles[projectFile].openFiles.excl(fileuri)
if projectFiles[projectFile].openFiles.len == 0:
debugLog "Trying to stop nimsuggest"
debugLog "Stopped nimsuggest with code: ",
getNimsuggest(fileuri).stopNimsuggest()
debugLog "No more open files for project ", projectFile
debugLog "Cleaning up dirty files"
for dirtyfile in projectFiles[openFiles[fileuri].projectFile].dirtyFiles:
removeFile(dirtyfile)

debugLog "Deleting context"
projectFiles.del(projectFile)
openFiles.del(fileuri)
of "textDocument/didSave":
message.textDocumentNotification(DidSaveTextDocumentParams, textDoc):
Expand Down

0 comments on commit 564190e

Please sign in to comment.