fix(lsp): ignore null responses for semanticTokens request (#21364)

The spec indicates that the response may be `null`, but it doesn't
really say what a `null` response means. Since neovim raises an error if
the response is `null`, I figured that ignoring it would be the safest
bet.

Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
This commit is contained in:
fsouza
2022-12-10 06:16:33 -05:00
committed by GitHub
parent f96fb23de6
commit 6d37d8cb17
3 changed files with 75 additions and 3 deletions

View File

@@ -304,6 +304,11 @@ function STHighlighter:process_response(response, client, version)
-- reset active request
state.active_request = {}
-- skip nil responses
if response == nil then
return
end
-- if we have a response to a delta request, update the state of our tokens
-- appropriately. if it's a full response, just use that
local tokens