Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(semantic-tokens): data field can't be nil #1111

Merged
merged 1 commit into from
May 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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