summaryrefslogtreecommitdiff
path: root/script-beta/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-11 15:11:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-11 15:11:30 +0800
commit4593b4732553b777b97726f7deb4d0b842f26909 (patch)
tree48a4fdada45c022fbce94b3b35a5255ec54f895d /script-beta/parser
parentf0613517eb750fd96a04d78401a78696afd18a30 (diff)
downloadlua-language-server-4593b4732553b777b97726f7deb4d0b842f26909.zip
fix #249 避免递归类型推测
Diffstat (limited to 'script-beta/parser')
-rw-r--r--script-beta/parser/guide.lua13
1 files changed, 9 insertions, 4 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index 8058328c..d5f16486 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -3554,10 +3554,7 @@ function m.searchInfer(status, obj)
obj = value
end
- local cache, makeCache
- if status.deep then
- cache, makeCache = m.getRefCache(status, obj, 'infer')
- end
+ local cache, makeCache = m.getRefCache(status, obj, 'infer')
if cache then
for i = 1, #cache do
status.results[#status.results+1] = cache[i]
@@ -3569,6 +3566,14 @@ function m.searchInfer(status, obj)
status.cache.clock = status.cache.clock or osClock()
end
+ if not status.cache.lockInfer then
+ status.cache.lockInfer = {}
+ end
+ if status.cache.lockInfer[obj] then
+ return
+ end
+ status.cache.lockInfer[obj] = true
+
local checked = m.inferCheckDoc(status, obj)
or m.inferCheckUpDoc(status, obj)
or m.inferCheckFieldDoc(status, obj)