Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Dec 19, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: token_edit.data might be null on deletion
  • Loading branch information
tiagovla committed Dec 18, 2022
commit 8a39dac1589249f627c5ed8b278597b712a49cf8
4 changes: 3 additions & 1 deletion runtime/lua/vim/lsp/semantic_tokens.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down