diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-10-22 21:13:56 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-10-22 21:13:56 +0800 |
commit | 5f71dbebfe0912b4db84b5452027e26c57a1efad (patch) | |
tree | 194c402a750111bb54e35bd738e6e3df06d3820f /script-beta/parser/guide.lua | |
parent | 2d4bb16df19575affddd7b9a1d5aaa8f2b9ade99 (diff) | |
download | lua-language-server-5f71dbebfe0912b4db84b5452027e26c57a1efad.zip |
暂且增加一下上限
Diffstat (limited to 'script-beta/parser/guide.lua')
-rw-r--r-- | script-beta/parser/guide.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua index 0b435204..c14dbb77 100644 --- a/script-beta/parser/guide.lua +++ b/script-beta/parser/guide.lua @@ -1987,10 +1987,8 @@ function m.searchSameFields(status, simple, mode) start = 1, } end - local i = 0 local max = 0 - while max <= 9999 do - i = i + 1 + for i = 1, 1e6 do local data = queue[i] if not data then return @@ -2000,6 +1998,10 @@ function m.searchSameFields(status, simple, mode) max = max + 1 status.cache.count = status.cache.count + 1 m.checkSameSimple(status, simple, data, mode, status.results, queue) + if max >= 10000 then + logWarn('Queue too large!') + break + end end end end @@ -2203,7 +2205,7 @@ function m.searchRefs(status, obj, mode) end end -- 检查simple - if status.depth <= 10 then + if status.depth <= 100 then local simple = m.getSimple(obj) if simple then m.searchSameFields(status, simple, mode) |