summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-03 19:33:29 +0800
committersumneko <sumneko@hotmail.com>2019-04-03 19:33:29 +0800
commit5edda40151d5eed6605009346217d1da3bcb9ae6 (patch)
treed9f17a2e89b8be6a589d13d8dbe1f9c4d74ef0fa /server/test
parent289a780f38c24a7ee0f4ca9502214b41fe11fc30 (diff)
downloadlua-language-server-5edda40151d5eed6605009346217d1da3bcb9ae6.zip
更新语法解析
Diffstat (limited to 'server/test')
-rw-r--r--server/test/completion/init.lua2
-rw-r--r--server/test/definition/init.lua2
-rw-r--r--server/test/diagnostics/init.lua2
-rw-r--r--server/test/document_symbol/init.lua2
-rw-r--r--server/test/find_lib/init.lua2
-rw-r--r--server/test/full/init.lua2
-rw-r--r--server/test/highlight/init.lua2
-rw-r--r--server/test/hover/init.lua2
-rw-r--r--server/test/references/init.lua2
-rw-r--r--server/test/rename/init.lua2
-rw-r--r--server/test/signature/init.lua2
-rw-r--r--server/test/type_inference/init.lua2
12 files changed, 12 insertions, 12 deletions
diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua
index 2f965bcb..a36d0cd5 100644
--- a/server/test/completion/init.lua
+++ b/server/test/completion/init.lua
@@ -103,7 +103,7 @@ function TEST(script)
return function (expect)
local pos = script:find('@', 1, true) - 1
local new_script = script:gsub('@', ' ')
- local ast = parser:ast(new_script)
+ local ast = parser:ast(new_script, 'lua', 'Lua 5.4')
local vm = buildVM(ast)
assert(vm)
local word = findWord(pos, new_script)
diff --git a/server/test/definition/init.lua b/server/test/definition/init.lua
index f2b2833c..59cf6d3d 100644
--- a/server/test/definition/init.lua
+++ b/server/test/definition/init.lua
@@ -40,7 +40,7 @@ function TEST(script)
local finish = script:find('?>', 1, true)
local pos = (start + finish) // 2 + 1
local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
- local ast = parser:ast(new_script)
+ local ast = parser:ast(new_script, 'lua', 'Lua 5.4')
assert(ast)
local vm = buildVM(ast)
assert(vm)
diff --git a/server/test/diagnostics/init.lua b/server/test/diagnostics/init.lua
index dc060ba4..e0893286 100644
--- a/server/test/diagnostics/init.lua
+++ b/server/test/diagnostics/init.lua
@@ -41,7 +41,7 @@ end
function TEST(script)
local new_script, target = catch_target(script)
local lsp = service()
- local ast = parser:ast(new_script)
+ local ast = parser:ast(new_script, 'lua', 'Lua 5.4')
assert(ast)
local lines = parser:lines(new_script)
local vm = buildVM(ast, lsp)
diff --git a/server/test/document_symbol/init.lua b/server/test/document_symbol/init.lua
index 929c2253..f14c5951 100644
--- a/server/test/document_symbol/init.lua
+++ b/server/test/document_symbol/init.lua
@@ -76,7 +76,7 @@ end
function TEST(script)
return function (expect)
- local ast = parser:ast(script)
+ local ast = parser:ast(script, 'lua', 'Lua 5.4')
local vm = buildVM(ast)
assert(vm)
local result = core.documentSymbol(vm)
diff --git a/server/test/find_lib/init.lua b/server/test/find_lib/init.lua
index ea650970..5f7c5dce 100644
--- a/server/test/find_lib/init.lua
+++ b/server/test/find_lib/init.lua
@@ -10,7 +10,7 @@ function TEST(fullkey)
local finish = script:find('?>', 1, true)
local pos = (start + finish) // 2 + 1
local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
- local ast = parser:ast(new_script)
+ local ast = parser:ast(new_script, 'lua', 'Lua 5.4')
assert(ast)
local vm = buildVM(ast)
assert(vm)
diff --git a/server/test/full/init.lua b/server/test/full/init.lua
index 145a2113..2c92e90b 100644
--- a/server/test/full/init.lua
+++ b/server/test/full/init.lua
@@ -4,7 +4,7 @@ local parser = require 'parser'
rawset(_G, 'TEST', true)
function TEST(script)
- local ast = parser:ast(script)
+ local ast = parser:ast(script, 'lua', 'Lua 5.4')
assert(ast)
local vm, err = buildVM(ast)
assert(vm, err)
diff --git a/server/test/highlight/init.lua b/server/test/highlight/init.lua
index 4e68de0c..e26b0ab3 100644
--- a/server/test/highlight/init.lua
+++ b/server/test/highlight/init.lua
@@ -39,7 +39,7 @@ function TEST(newName)
local finish = script:find('?>', 1, true)
local pos = (start + finish) // 2 + 1
local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
- local ast = parser:ast(new_script)
+ local ast = parser:ast(new_script, 'lua', 'Lua 5.4')
assert(ast)
local vm = buildVM(ast)
assert(vm)
diff --git a/server/test/hover/init.lua b/server/test/hover/init.lua
index 9e1d6ada..95be529f 100644
--- a/server/test/hover/init.lua
+++ b/server/test/hover/init.lua
@@ -10,7 +10,7 @@ function TEST(script)
local finish = script:find('?>', 1, true)
local pos = (start + finish) // 2 + 1
local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
- local ast = parser:ast(new_script)
+ local ast = parser:ast(new_script, 'lua', 'Lua 5.4')
local vm = buildVM(ast)
assert(vm)
local source = core.findSource(vm, pos)
diff --git a/server/test/references/init.lua b/server/test/references/init.lua
index c512ca5d..6b53decb 100644
--- a/server/test/references/init.lua
+++ b/server/test/references/init.lua
@@ -38,7 +38,7 @@ function TEST(script)
local finish = script:find('?>', 1, true)
local pos = (start + finish) // 2 + 1
local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
- local ast = parser:ast(new_script)
+ local ast = parser:ast(new_script, 'lua', 'Lua 5.4')
assert(ast)
local vm = buildVM(ast)
assert(vm)
diff --git a/server/test/rename/init.lua b/server/test/rename/init.lua
index 09900e3d..1ad8994a 100644
--- a/server/test/rename/init.lua
+++ b/server/test/rename/init.lua
@@ -39,7 +39,7 @@ function TEST(newName)
local finish = script:find('?>', 1, true)
local pos = (start + finish) // 2 + 1
local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
- local ast = parser:ast(new_script)
+ local ast = parser:ast(new_script, 'lua', 'Lua 5.4')
assert(ast)
local vm = buildVM(ast)
assert(vm)
diff --git a/server/test/signature/init.lua b/server/test/signature/init.lua
index 3e83b5ba..0910ab83 100644
--- a/server/test/signature/init.lua
+++ b/server/test/signature/init.lua
@@ -8,7 +8,7 @@ function TEST(script)
return function (expect)
local pos = script:find('@', 1, true)
local new_script = script:gsub('@', '')
- local ast = parser:ast(new_script)
+ local ast = parser:ast(new_script, 'lua', 'Lua 5.4')
local vm = buildVM(ast)
assert(vm)
local hovers = core.signature(vm, pos)
diff --git a/server/test/type_inference/init.lua b/server/test/type_inference/init.lua
index 4961b4b0..c966eb18 100644
--- a/server/test/type_inference/init.lua
+++ b/server/test/type_inference/init.lua
@@ -10,7 +10,7 @@ function TEST(res)
local finish = script:find('?>', 1, true)
local pos = (start + finish) // 2 + 1
local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
- local ast = parser:ast(new_script)
+ local ast = parser:ast(new_script, 'lua', 'Lua 5.4')
local vm = buildVM(ast)
assert(vm)
local result = core.findSource(vm, pos)