aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-05-22 12:12:52 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2024-05-22 12:12:52 +0200
commitb777ef7207c3dee575355f78d019b4ff2f0fb460 (patch)
treeecef10cd93c1380c1922cc7e71a031d7f5ec5bd2
parentbd0b94136ef6511b86a509aca2fd2e1cf355ce3d (diff)
downloadvis-lspc-b777ef7207c3dee575355f78d019b4ff2f0fb460.tar.gz
vis-lspc-b777ef7207c3dee575355f78d019b4ff2f0fb460.zip
fix open file tracking after didClose
Properly remove the reference to the language server to which we send the didClose notification. Additionally, remove the open file reference if this was the last language server for the closed file. Fixes: 3c4b876ce21be2928c1bab33856d2294e6b43f5b
-rw-r--r--init.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/init.lua b/init.lua
index ddad310..7073136 100644
--- a/init.lua
+++ b/init.lua
@@ -1204,7 +1204,10 @@ local function lspc_close(ls, file)
ls_send_notification(ls, 'textDocument/didClose', {
textDocument = {uri = path_to_uri(file.path)},
})
- lspc.open_files[file.path][ls] = nil
+ lspc.open_files[file.path].language_servers[ls] = nil
+ if not next(lspc.open_files[file.path].language_servers) then
+ lspc.open_files[file.path] = nil
+ end
end
-- register a file as open with a language server and setup close and save event handlers