Skip to content

Commit

Permalink
fix(semantic-tokens): data field can't be nil
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinhwang91 authored and sumneko committed May 2, 2022
1 parent f79486e commit 299d740
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions script/core/semantic-tokens.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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()
Expand Down Expand Up @@ -849,7 +849,7 @@ return function (uri, start, finish)
end

if #results == 0 then
return {}
return results
end

results = solveMultilineAndOverlapping(state, results)
Expand Down

0 comments on commit 299d740

Please sign in to comment.