summaryrefslogtreecommitdiff
path: root/script-beta/vm/guideInterface.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta/vm/guideInterface.lua')
-rw-r--r--script-beta/vm/guideInterface.lua31
1 files changed, 9 insertions, 22 deletions
diff --git a/script-beta/vm/guideInterface.lua b/script-beta/vm/guideInterface.lua
index d68e637f..01f5e0e0 100644
--- a/script-beta/vm/guideInterface.lua
+++ b/script-beta/vm/guideInterface.lua
@@ -5,7 +5,7 @@ local guide = require 'parser.guide'
local m = {}
-function m.searchFileReturn(results, ast, index, mode)
+function m.searchFileReturn(results, ast, index)
local returns = ast.returns
if not returns then
return
@@ -13,25 +13,12 @@ function m.searchFileReturn(results, ast, index, mode)
for _, ret in ipairs(returns) do
local exp = ret[index]
if exp then
- if exp.type == 'table' then
- vm.mergeResults(results, { exp })
- else
- local newRes
- if mode == 'ref' then
- newRes = vm.getRefs(exp)
- else
- newRes = vm.getDefs(exp)
- end
- if #newRes > 0 then
- vm.mergeResults(results, newRes)
- end
- vm.mergeResults(results, { exp })
- end
+ vm.mergeResults(results, { exp })
end
end
end
-function m.require(args, index, mode)
+function m.require(args, index)
local reqName = args[1] and args[1][1]
if not reqName then
return nil
@@ -43,14 +30,14 @@ function m.require(args, index, mode)
if not files.eq(myUri, uri) then
local ast = files.getAst(uri)
if ast then
- m.searchFileReturn(results, ast.ast, index, mode)
+ m.searchFileReturn(results, ast.ast, index)
end
end
end
return results
end
-function m.dofile(args, index, mode)
+function m.dofile(args, index)
local reqName = args[1] and args[1][1]
if not reqName then
return
@@ -62,7 +49,7 @@ function m.dofile(args, index, mode)
if not files.eq(myUri, uri) then
local ast = files.getAst(uri)
if ast then
- m.searchFileReturn(results, ast.ast, index, mode)
+ m.searchFileReturn(results, ast.ast, index)
end
end
end
@@ -71,16 +58,16 @@ end
vm.interface = {}
-function vm.interface.call(func, args, index, mode)
+function vm.interface.call(func, args, index)
local lib = vm.getLibrary(func)
if not lib then
return nil
end
if lib.name == 'require' and index == 1 then
- return m.require(args, index, mode)
+ return m.require(args, index)
end
if lib.name == 'dofile' then
- return m.dofile(args, index, mode)
+ return m.dofile(args, index)
end
end