summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changelog.md1
-rw-r--r--script/core/semantic-tokens.lua7
2 files changed, 5 insertions, 3 deletions
diff --git a/changelog.md b/changelog.md
index 0d553d6c..4a9413f7 100644
--- a/changelog.md
+++ b/changelog.md
@@ -6,6 +6,7 @@
+ `type-check`: removed for now
+ `no-implicit-any`: renamed to `no-unknown`
* `CHG` formatter: no longer need` --preview`
+* `FIX` semantic: color of `function`
* `FIX` [#1028](https://github.com/sumneko/lua-language-server/issues/1028)
## 2.6.8
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