summaryrefslogtreecommitdiff
path: root/script-beta/parser
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-07-22 19:57:12 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-07-22 19:57:12 +0800
commit614dda013272a56d5370b387df69622a168090a4 (patch)
treecfa64882157d2a9470b2bece2af1358d49cf2737 /script-beta/parser
parent8a3e5ec178a45a68e468a504f06452308ba2f22c (diff)
downloadlua-language-server-614dda013272a56d5370b387df69622a168090a4.zip
支持require穿透
Diffstat (limited to 'script-beta/parser')
-rw-r--r--script-beta/parser/guide.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/script-beta/parser/guide.lua b/script-beta/parser/guide.lua
index db2aeae1..ee5bb425 100644
--- a/script-beta/parser/guide.lua
+++ b/script-beta/parser/guide.lua
@@ -1218,6 +1218,7 @@ function m.checkSameSimpleIncall(status, ref, start, queue)
queue[#queue+1] = {
obj = obj,
start = start,
+ force = true,
}
end
end
@@ -1327,6 +1328,9 @@ function m.searchRefsAsFunctionReturn(status, obj, mode)
status.results[#status.results+1] = obj
-- 搜索所在函数
local currentFunc = m.getParentFunction(obj)
+ if currentFunc.type == 'main' then
+ return
+ end
local returns = currentFunc.returns
if not returns then
return