summaryrefslogtreecommitdiff
path: root/server/test/definition
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-03 19:10:26 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-03 19:10:26 +0800
commit2b2d9270b278d6f8b9eea5f20e3246355b91d711 (patch)
tree2f7dd5288178b9e1418725a58791d907d6f5d1fa /server/test/definition
parentbb58cb1593f7603c5eeb2bda59e23d27dc945e0d (diff)
downloadlua-language-server-2b2d9270b278d6f8b9eea5f20e3246355b91d711.zip
编译语法树与朝赵定义分离
Diffstat (limited to 'server/test/definition')
-rw-r--r--server/test/definition/init.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/test/definition/init.lua b/server/test/definition/init.lua
index 7d4549a1..435ab2f8 100644
--- a/server/test/definition/init.lua
+++ b/server/test/definition/init.lua
@@ -45,10 +45,11 @@ function TEST(script)
local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
local ast, err = parser:ast(new_script)
assert(ast)
+ local results = matcher.compile(ast)
+ assert(results)
- local suc, result = matcher.definition(ast, pos)
- if suc then
- assert(suc)
+ local result = matcher.definition(results, pos)
+ if result then
assert(founded(target, result))
else
assert(#target == 0)