summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-15 03:23:39 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-15 03:23:39 +0800
commitc45d862d3a3f0e0588a27b9e7cd8ba84afd454a8 (patch)
tree7ca0779c82a4fd32959add38b6f25adc755f654f /script
parent89631834c454f1b87e767af6a576180e2bb6e145 (diff)
downloadlua-language-server-c45d862d3a3f0e0588a27b9e7cd8ba84afd454a8.zip
fix semantic
Diffstat (limited to 'script')
-rw-r--r--script/core/semantic-tokens.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/script/core/semantic-tokens.lua b/script/core/semantic-tokens.lua
index 5917a1a3..568bb222 100644
--- a/script/core/semantic-tokens.lua
+++ b/script/core/semantic-tokens.lua
@@ -165,7 +165,11 @@ local Care = util.switch()
-- 5. Class declaration
-- only search this local
if loc.bindDocs then
- for i, doc in ipairs(loc.bindDocs) do
+ for i = #loc.bindDocs, 1, -1 do
+ local doc = loc.bindDocs[i]
+ if doc.type == 'doc.type' then
+ break
+ end
if doc.type == "doc.class" and doc.bindSources then
for _, src in ipairs(doc.bindSources) do
if src == loc then