diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-06-14 15:02:49 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-06-14 15:02:49 +0800 |
commit | d9f97b8e0b3938802d16a14f917a04cb43ebc648 (patch) | |
tree | 966d069d454cf70b51c01e6e45aec6451035dad3 /script/core | |
parent | 4259e92b65dc5091147eea593b831cf6e41ee208 (diff) | |
download | lua-language-server-d9f97b8e0b3938802d16a14f917a04cb43ebc648.zip |
fix #2129
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/semantic-tokens.lua | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua index 4d191b69..cd19e2ee 100644 --- a/script/core/semantic-tokens.lua +++ b/script/core/semantic-tokens.lua @@ -138,12 +138,20 @@ local Care = util.switch() local uri = guide.getUri(loc) -- 1. 值为函数的局部变量 | Local variable whose value is a function if vm.getInfer(source):hasFunction(uri) then - results[#results+1] = { - start = source.start, - finish = source.finish, - type = define.TokenTypes['function'], - modifieres = define.TokenModifiers.declaration, - } + if source.type == 'local' then + results[#results+1] = { + start = source.start, + finish = source.finish, + type = define.TokenTypes['function'], + modifieres = define.TokenModifiers.declaration, + } + else + results[#results+1] = { + start = source.start, + finish = source.finish, + type = define.TokenTypes['function'], + } + end return end -- 3. 特殊变量 | Special variableif source[1] == '_ENV' then |