From c45d862d3a3f0e0588a27b9e7cd8ba84afd454a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 15 Apr 2022 03:23:39 +0800 Subject: fix semantic --- script/core/semantic-tokens.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3