Skip to content

Commit 01f8679

Browse files
authored
Merge pull request #1009 from kevinhwang91/fix-semantic-priority
fix(semantic-tokens): coreect token type priority
2 parents 499cd3a + b207c28 commit 01f8679

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Diff for: script/core/semantic-tokens.lua

+12-12
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,7 @@ local Care = util.switch()
161161
}
162162
return
163163
end
164-
-- 5. References to other functions
165-
if infer.hasType(loc, 'function') then
166-
results[#results+1] = {
167-
start = source.start,
168-
finish = source.finish,
169-
type = define.TokenTypes['function'],
170-
modifieres = source.type == 'setlocal' and define.TokenModifiers.declaration or nil,
171-
}
172-
return
173-
end
174-
-- 6. Class declaration
164+
-- 5. Class declaration
175165
-- only search this local
176166
if loc.bindDocs then
177167
for i, doc in ipairs(loc.bindDocs) do
@@ -189,7 +179,17 @@ local Care = util.switch()
189179
end
190180
end
191181
end
192-
-- 6. const 变量 | Const variable
182+
-- 6. References to other functions
183+
if infer.hasType(loc, 'function') then
184+
results[#results+1] = {
185+
start = source.start,
186+
finish = source.finish,
187+
type = define.TokenTypes['function'],
188+
modifieres = source.type == 'setlocal' and define.TokenModifiers.declaration or nil,
189+
}
190+
return
191+
end
192+
-- 7. const 变量 | Const variable
193193
if loc.attrs then
194194
for _, attr in ipairs(loc.attrs) do
195195
local name = attr[1]

0 commit comments

Comments
 (0)