summaryrefslogtreecommitdiff
path: root/server/test/definition
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-07 11:28:15 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-07 11:28:15 +0800
commit3ccf8b1b0e1048ee9056c610829d49679df6ac3b (patch)
tree773c10db34ca02a404fb67cd8a390e024f4cec56 /server/test/definition
parent3eaa1ac1e6731f595f892e6b96dbfe4c5c42fc75 (diff)
downloadlua-language-server-3ccf8b1b0e1048ee9056c610829d49679df6ac3b.zip
支持重新赋值
Diffstat (limited to 'server/test/definition')
-rw-r--r--server/test/definition/init.lua2
-rw-r--r--server/test/definition/method.lua11
2 files changed, 12 insertions, 1 deletions
diff --git a/server/test/definition/init.lua b/server/test/definition/init.lua
index e5dccd4f..11a79391 100644
--- a/server/test/definition/init.lua
+++ b/server/test/definition/init.lua
@@ -45,7 +45,7 @@ function TEST(script)
local finish = script:find('?>', 1, true)
local pos = (start + finish) // 2 + 1
local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
- local ast, err = parser:ast(new_script)
+ local ast = parser:ast(new_script)
assert(ast)
local results = matcher.compile(ast)
assert(results)
diff --git a/server/test/definition/method.lua b/server/test/definition/method.lua
index ac9e95e7..05820e97 100644
--- a/server/test/definition/method.lua
+++ b/server/test/definition/method.lua
@@ -100,3 +100,14 @@ local obj = setmetatable({
}
}, { __index = mt })
]]
+
+TEST [[
+local sm = setmetatable
+local mt
+mt.__index = mt
+function mt:<!method1!>()
+end
+
+local obj = sm({}, mt)
+obj:<?method1?>()
+]]