fix(lsp): token_edit.data might be null on deletion (#21462)

This commit is contained in:
tiagovla
2022-12-19 05:24:27 -03:00
committed by GitHub
parent a7332ba9b4
commit f4d8e992bf
2 changed files with 33 additions and 2 deletions

View File

@@ -323,7 +323,9 @@ function STHighlighter:process_response(response, client, version)
local idx = 1
for _, token_edit in ipairs(token_edits) do
vim.list_extend(tokens, old_tokens, idx, token_edit.start)
vim.list_extend(tokens, token_edit.data)
if token_edit.data then
vim.list_extend(tokens, token_edit.data)
end
idx = token_edit.start + token_edit.deleteCount + 1
end
vim.list_extend(tokens, old_tokens, idx)