diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-18 02:39:47 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-18 02:39:47 +0800 |
commit | 3494b7f1d0e93060cf0826f4f6c1b81d0d5e37a5 (patch) | |
tree | 4187ed3a012a64e9215284a90d89224106e837f4 /script/parser/luadoc.lua | |
parent | c0b4b0299dc7b7efc667ef7fb0957e079ad8a411 (diff) | |
download | lua-language-server-3494b7f1d0e93060cf0826f4f6c1b81d0d5e37a5.zip |
update
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r-- | script/parser/luadoc.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index 061110c8..95e902af 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -1471,17 +1471,26 @@ local function bindDocsBetween(sources, binded, bindSources, start, finish) end -- 从前往后进行绑定 + local skipUntil for i = index, max do local src = sources[i] if src and src.start >= start then if src.start >= finish then break end + if skipUntil then + if skipUntil > src.start then + goto CONTINUE + else + skipUntil = nil + end + end -- 遇到table后中断,处理以下情况: -- ---@type AAA -- local t = {x = 1, y = 2} if src.type == 'table' then - break + skipUntil = skipUntil or src.finish + goto CONTINUE end if src.start >= start then if src.type == 'local' @@ -1498,6 +1507,7 @@ local function bindDocsBetween(sources, binded, bindSources, start, finish) bindSources[#bindSources+1] = src end end + ::CONTINUE:: end end end |