summaryrefslogtreecommitdiff
path: root/script-beta/parser/guide.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-09-24 22:03:18 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-09-24 22:03:18 +0800
commit475eff6d38444e54c4b8b728757072516e354f98 (patch)
treec4aed218ed5f4b86e76bb39878b6a37427bd209f /script-beta/parser/guide.lua
parent412f7946509ba124cb5895cf1ae0bf923dc0442b (diff)
downloadlua-language-server-475eff6d38444e54c4b8b728757072516e354f98.zip
修正一个死循环
Diffstat (limited to 'script-beta/parser/guide.lua')
-rw-r--r--script-beta/parser/guide.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index e377b6c8..2dfba346 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -2780,7 +2780,10 @@ local function mergeFunctionReturns(status, source, index)
local rtn = returns[i]
if rtn[index] then
if rtn[index].type == 'call' then
- m.inferByCallReturnAndIndex(status, rtn[index], index)
+ if not m.checkReturnMark(status, rtn[index]) then
+ m.checkReturnMark(status, rtn[index], true)
+ m.inferByCallReturnAndIndex(status, rtn[index], index)
+ end
else
local newStatus = m.status(status)
m.searchInfer(newStatus, rtn[index])
@@ -2808,7 +2811,9 @@ function m.inferByCallReturnAndIndex(status, call, index)
if src.type == 'library' then
mergeLibraryFunctionReturns(status, src.value, index)
else
- mergeFunctionReturns(status, src.value, index)
+ if not m.checkReturnMark(status, src.value, true) then
+ mergeFunctionReturns(status, src.value, index)
+ end
end
end
end