summaryrefslogtreecommitdiff
path: root/script-beta/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-08-16 01:58:46 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-08-16 01:58:46 +0800
commitc3cec6c8cd20c319c291431fbec55f1d1d596c6d (patch)
tree55047c4bac77a2bf3d82d1286612cdd799c18949 /script-beta/parser
parentbb1e4a1d0ef31d0ed5d82df22a103cecfe79b251 (diff)
downloadlua-language-server-c3cec6c8cd20c319c291431fbec55f1d1d596c6d.zip
限制回看层级
Diffstat (limited to 'script-beta/parser')
-rw-r--r--script-beta/parser/guide.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index 5e7a731a..32f5107e 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -1387,6 +1387,15 @@ function m.checkSameSimpleAsTableField(status, ref, start, queue)
end
end
+function m.checkBackCount(status)
+ status.cache.back = status.cache.back or 0
+ if status.cache.back >= (status.interface.backlimit or 0) then
+ return true
+ end
+ status.cache.back = status.cache.back + 1
+ return false
+end
+
function m.checkSameSimpleAsReturn(status, ref, start, queue)
if ref.parent.type ~= 'return' then
return
@@ -1396,6 +1405,9 @@ function m.checkSameSimpleAsReturn(status, ref, start, queue)
if ref.parent.parent.type ~= 'main' then
return
end
+ if m.checkBackCount(status) then
+ return
+ end
local newStatus = m.status(status)
m.searchRefsAsFunctionReturn(newStatus, ref, 'ref')
for _, res in ipairs(newStatus.results) do
@@ -1420,6 +1432,9 @@ function m.checkSameSimpleAsSetValue(status, ref, start, queue)
if m.checkValueMark(status, ref, parent) then
return
end
+ if m.checkBackCount(status) then
+ return
+ end
local obj
if parent.type == 'local'
or parent.type == 'setglobal'