summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
authorkevinhwang91 <kevin.hwang@live.com>2022-05-02 14:07:37 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-05-02 23:40:33 +0800
commit299d740c34f7573353f998a0e9f48ba14c678671 (patch)
tree7464170806ec91a2427d75936217e73d4ea6ef1b /script/core
parentf79486e3d6bcda2320c3099510b67ae4be46c1d1 (diff)
downloadlua-language-server-299d740c34f7573353f998a0e9f48ba14c678671.zip
fix(semantic-tokens): `data` field can't be nil
Diffstat (limited to 'script/core')
-rw-r--r--script/core/semantic-tokens.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua
index 65c72c11..33449013 100644
--- a/script/core/semantic-tokens.lua
+++ b/script/core/semantic-tokens.lua
@@ -792,12 +792,13 @@ end
---@async
return function (uri, start, finish)
+ local results = {}
if not config.get(uri, 'Lua.semantic.enable') then
- return nil
+ return results
end
local state = files.getState(uri)
if not state then
- return nil
+ return results
end
local options = {
@@ -810,7 +811,6 @@ return function (uri, start, finish)
keyword = config.get(uri, 'Lua.semantic.keyword'),
}
- local results = {}
guide.eachSourceBetween(state.ast, start, finish, function (source) ---@async
Care(source.type, source, options, results)
await.delay()
@@ -849,7 +849,7 @@ return function (uri, start, finish)
end
if #results == 0 then
- return {}
+ return results
end
results = solveMultilineAndOverlapping(state, results)