Skip to content

Commit

Permalink
Merge pull request #1009 from kevinhwang91/fix-semantic-priority
Browse files Browse the repository at this point in the history
fix(semantic-tokens): coreect token type priority
  • Loading branch information
sumneko authored Apr 2, 2022
2 parents 499cd3a + b207c28 commit 01f8679
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions script/core/semantic-tokens.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,7 @@ local Care = util.switch()
}
return
end
-- 5. References to other functions
if infer.hasType(loc, 'function') then
results[#results+1] = {
start = source.start,
finish = source.finish,
type = define.TokenTypes['function'],
modifieres = source.type == 'setlocal' and define.TokenModifiers.declaration or nil,
}
return
end
-- 6. Class declaration
-- 5. Class declaration
-- only search this local
if loc.bindDocs then
for i, doc in ipairs(loc.bindDocs) do
Expand All @@ -189,7 +179,17 @@ local Care = util.switch()
end
end
end
-- 6. const 变量 | Const variable
-- 6. References to other functions
if infer.hasType(loc, 'function') then
results[#results+1] = {
start = source.start,
finish = source.finish,
type = define.TokenTypes['function'],
modifieres = source.type == 'setlocal' and define.TokenModifiers.declaration or nil,
}
return
end
-- 7. const 变量 | Const variable
if loc.attrs then
for _, attr in ipairs(loc.attrs) do
local name = attr[1]
Expand Down

0 comments on commit 01f8679

Please sign in to comment.