summaryrefslogtreecommitdiff
path: root/script-beta/vm/eachDef.lua
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/vm/eachDef.lua
parent8a3e5ec178a45a68e468a504f06452308ba2f22c (diff)
downloadlua-language-server-614dda013272a56d5370b387df69622a168090a4.zip
支持require穿透
Diffstat (limited to 'script-beta/vm/eachDef.lua')
-rw-r--r--script-beta/vm/eachDef.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/script-beta/vm/eachDef.lua b/script-beta/vm/eachDef.lua
index 104b77ba..423b9e8d 100644
--- a/script-beta/vm/eachDef.lua
+++ b/script-beta/vm/eachDef.lua
@@ -8,8 +8,13 @@ local m = {}
function m.searchFileReturn(results, ast)
local returns = ast.returns
for _, ret in ipairs(returns) do
- if ret[1] then
- m.eachDef(ret[1], results)
+ local first = ret[1]
+ if first then
+ local newRes = m.eachDef(ret[1])
+ if #newRes == 0 then
+ newRes[1] = first
+ end
+ vm.mergeResults(results, newRes)
end
end
end