summaryrefslogtreecommitdiff
path: root/server-beta/test/definition/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-10-19 15:18:43 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-10-19 15:18:43 +0800
commit696fae86c9175cfc1b210c964b8efda85ed6421f (patch)
treedd79a633233ff409ef5f54195e4c29fb60246c78 /server-beta/test/definition/init.lua
parent5bcb7bdf0ae97c59172289b1919e0a5451fba03e (diff)
downloadlua-language-server-696fae86c9175cfc1b210c964b8efda85ed6421f.zip
整理代码
Diffstat (limited to 'server-beta/test/definition/init.lua')
-rw-r--r--server-beta/test/definition/init.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/server-beta/test/definition/init.lua b/server-beta/test/definition/init.lua
index cc8c584b..f5a663cf 100644
--- a/server-beta/test/definition/init.lua
+++ b/server-beta/test/definition/init.lua
@@ -1,4 +1,5 @@
local core = require 'core.definition'
+local engineer = require 'core.engineer'
local parser = require 'parser'
rawset(_G, 'TEST', true)
@@ -41,8 +42,12 @@ function TEST(script)
local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
local ast = parser:compile(new_script, 'lua', 'Lua 5.3')
assert(ast)
+ local file = {
+ ast = ast,
+ searcher = engineer(ast),
+ }
- local results = core(ast, new_script, pos)
+ local results = core(file, pos)
if results then
local positions = {}
for i, result in ipairs(results) do