summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-05 14:28:09 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-05 14:28:09 +0800
commite5131f6964d22e26cfcc6075e547666452df699c (patch)
treea5f14c0fa5384a3495d73657a322991a44508d37 /server/test
parent750dc445ea6f0d9010b73f9a8b884e6ca55dfb26 (diff)
downloadlua-language-server-e5131f6964d22e26cfcc6075e547666452df699c.zip
局部函数的hover
Diffstat (limited to 'server/test')
-rw-r--r--server/test/example/vm.lua1
-rw-r--r--server/test/hover/init.lua7
2 files changed, 4 insertions, 4 deletions
diff --git a/server/test/example/vm.lua b/server/test/example/vm.lua
index 965a0bec..d293fc38 100644
--- a/server/test/example/vm.lua
+++ b/server/test/example/vm.lua
@@ -434,7 +434,6 @@ function mt:buildFunction(exp, object)
func.argValues[#func.args] = self:getValue(var)
elseif arg.type == '...' then
self:createDots(#func.args+1, arg)
- func.hasDots = true
for _ = 1, 10 do
func.argValues[#func.argValues+1] = self:createValue('any', arg)
end
diff --git a/server/test/hover/init.lua b/server/test/hover/init.lua
index cda10baa..e5686c9e 100644
--- a/server/test/hover/init.lua
+++ b/server/test/hover/init.lua
@@ -1,5 +1,6 @@
local parser = require 'parser'
local core = require 'core'
+local buildVM = require 'vm'
rawset(_G, 'TEST', true)
@@ -10,10 +11,10 @@ function TEST(script)
local pos = (start + finish) // 2 + 1
local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
local ast = parser:ast(new_script)
- local vm = core.vm(ast)
+ local vm = buildVM(ast)
assert(vm)
- local result, source = core.findSource(vm, pos)
- local hover = core.hover(result, source)
+ local source = core.findSource(vm, pos)
+ local hover = core.hover(source)
if expect then
assert(hover)
expect = expect:gsub('^[\r\n]*(.-)[\r\n]*$', '%1'):gsub('\r\n', '\n')