diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2024-05-22 12:12:52 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2024-05-22 12:12:52 +0200 |
| commit | b777ef7207c3dee575355f78d019b4ff2f0fb460 (patch) | |
| tree | ecef10cd93c1380c1922cc7e71a031d7f5ec5bd2 | |
| parent | bd0b94136ef6511b86a509aca2fd2e1cf355ce3d (diff) | |
| download | vis-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.lua | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |
