summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkevinhwang91 <kevin.hwang@live.com>2022-02-03 13:22:39 +0800
committerkevinhwang91 <kevin.hwang@live.com>2022-02-03 13:22:39 +0800
commit3428b2082054ea4df098e611bd3024fa7129d97f (patch)
treec6488053b6343153440325e5b64623d49ab19b56
parent1608befdb482355744cda0b6891aaf68a9d662c3 (diff)
downloadlua-language-server-3428b2082054ea4df098e611bd3024fa7129d97f.zip
fix(semantic-tokens): `data` field can't be nil
`textDocument/semanticTokens/range` should return `SemanticTokens | null` from LSP specification. `data` field of the `SemanticTokens` must be a array, even if no result.
-rw-r--r--script/core/semantic-tokens.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua
index 6163cbbe..bb6282a4 100644
--- a/script/core/semantic-tokens.lua
+++ b/script/core/semantic-tokens.lua
@@ -849,7 +849,7 @@ return function (uri, start, finish)
end
if #results == 0 then
- return nil
+ return {}
end
results = solveMultilineAndOverlapping(state, results)