summaryrefslogtreecommitdiff
path: root/script-beta
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-08-27 13:23:54 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-08-27 13:23:54 +0800
commit057802df4049da0c71c47822b8baa7f99de1ba5e (patch)
tree571ba653133d7f4d082b0b0738662a1cacebdb29 /script-beta
parent8ab3e8e15ca366db726fc44c8bfacbb322f595aa (diff)
downloadlua-language-server-057802df4049da0c71c47822b8baa7f99de1ba5e.zip
暂存
Diffstat (limited to 'script-beta')
-rw-r--r--script-beta/core/completion.lua6
-rw-r--r--script-beta/vm/guideInterface.lua8
2 files changed, 8 insertions, 6 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua
index fe007368..2623037b 100644
--- a/script-beta/core/completion.lua
+++ b/script-beta/core/completion.lua
@@ -745,6 +745,11 @@ local function trySymbol(ast, text, offset, results)
end
end
+local function tryCallArg(ast, text, offset, results)
+ local parent, oop = findParent(ast, text, offset)
+
+end
+
local function completion(uri, offset)
local ast = files.getAst(uri)
local text = files.getText(uri)
@@ -754,6 +759,7 @@ local function completion(uri, offset)
if ast then
tryWord(ast, text, offset, results)
trySymbol(ast, text, offset, results)
+ tryCallArg(ast, text, offset, results)
else
local word = findWord(text, offset)
if word then
diff --git a/script-beta/vm/guideInterface.lua b/script-beta/vm/guideInterface.lua
index 0ecbd9a7..d7bb89e0 100644
--- a/script-beta/vm/guideInterface.lua
+++ b/script-beta/vm/guideInterface.lua
@@ -65,15 +65,11 @@ vm.interface = {}
vm.interface.searchLevel = 0
function vm.interface.call(func, args, index)
- local lib = vm.getLibrary(func)
- if not lib then
- return nil
- end
await.delay()
- if lib.name == 'require' and index == 1 then
+ if func.special == 'require' and index == 1 then
return m.require(args, index)
end
- if lib.name == 'dofile' then
+ if func.special == 'dofile' then
return m.dofile(args, index)
end
end