Skip to content

Commit b685d3a

Browse files
committed
fix: fix case where LSP progress autocommand errors because the value of the status is nil
Some language servers seem to improperly implement the lsp progress operations. This isn't technically our problem, but we can protect against this edge case easily without much work. Closes #38
1 parent 9d68fe9 commit b685d3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/astrolsp/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function M.progress(data)
5454
local id = ("%s.%s"):format(data.client_id, data.params.token)
5555
M.lsp_progress[id] = M.lsp_progress[id] and vim.tbl_deep_extend("force", M.lsp_progress[id], data.params.value)
5656
or data.params.value
57-
if M.lsp_progress[id].kind == "end" then
57+
if not M.lsp_progress[id] or M.lsp_progress[id].kind == "end" then
5858
vim.defer_fn(function()
5959
M.lsp_progress[id] = nil
6060
lsp_event "Progress"

0 commit comments

Comments
 (0)