Skip to content

Commit 299d740

Browse files
kevinhwang91sumneko
authored andcommitted
fix(semantic-tokens): data field can't be nil
1 parent f79486e commit 299d740

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

script/core/semantic-tokens.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -792,12 +792,13 @@ end
792792

793793
---@async
794794
return function (uri, start, finish)
795+
local results = {}
795796
if not config.get(uri, 'Lua.semantic.enable') then
796-
return nil
797+
return results
797798
end
798799
local state = files.getState(uri)
799800
if not state then
800-
return nil
801+
return results
801802
end
802803

803804
local options = {
@@ -810,7 +811,6 @@ return function (uri, start, finish)
810811
keyword = config.get(uri, 'Lua.semantic.keyword'),
811812
}
812813

813-
local results = {}
814814
guide.eachSourceBetween(state.ast, start, finish, function (source) ---@async
815815
Care(source.type, source, options, results)
816816
await.delay()
@@ -849,7 +849,7 @@ return function (uri, start, finish)
849849
end
850850

851851
if #results == 0 then
852-
return {}
852+
return results
853853
end
854854

855855
results = solveMultilineAndOverlapping(state, results)

0 commit comments

Comments
 (0)