summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-09 20:13:44 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-09 20:13:44 +0800
commita3f5b1ceb2b6722a28671cb6e2633b3fc0ae6713 (patch)
tree4d434b9f4fef940cd0be99657f8be5c040a592ad /script/core
parente9ed7d7572054337d9725bf9ca19eb628d2a7820 (diff)
downloadlua-language-server-a3f5b1ceb2b6722a28671cb6e2633b3fc0ae6713.zip
fix semantic of function
Diffstat (limited to 'script/core')
-rw-r--r--script/core/semantic-tokens.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua
index 552e17d4..04e36cd0 100644
--- a/script/core/semantic-tokens.lua
+++ b/script/core/semantic-tokens.lua
@@ -119,13 +119,14 @@ local Care = util.switch()
end
local loc = source.node or source
-- 1. 值为函数的局部变量 | Local variable whose value is a function
- if loc.refs then
- for _, ref in ipairs(loc.refs) do
+ if loc.ref then
+ for _, ref in ipairs(loc.ref) do
if ref.value and ref.value.type == 'function' then
results[#results+1] = {
start = source.start,
finish = source.finish,
type = define.TokenTypes['function'],
+ modifieres = define.TokenModifiers.declaration,
}
return
end
@@ -184,7 +185,7 @@ local Care = util.switch()
start = source.start,
finish = source.finish,
type = define.TokenTypes['function'],
- modifieres = source.type == 'setlocal' and define.TokenModifiers.declaration or nil,
+ modifieres = guide.isSet(source) and define.TokenModifiers.declaration or nil,
}
return
end