From 6d37d8cb17390419360c1459607beac2d93183b6 Mon Sep 17 00:00:00 2001 From: fsouza <108725+fsouza@users.noreply.github.com> Date: Sat, 10 Dec 2022 06:16:33 -0500 Subject: 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 --- runtime/lua/vim/lsp/semantic_tokens.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'runtime/lua') diff --git a/runtime/lua/vim/lsp/semantic_tokens.lua b/runtime/lua/vim/lsp/semantic_tokens.lua index 66e656abb6..83b414bf87 100644 --- a/runtime/lua/vim/lsp/semantic_tokens.lua +++ b/runtime/lua/vim/lsp/semantic_tokens.lua @@ -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 -- cgit