summaryrefslogtreecommitdiff
path: root/server/test/completion/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-19 15:20:20 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-19 15:20:20 +0800
commit58a8a075c9a83d5356ef49c6bd6122d7387b92ae (patch)
tree5b7f384240c9c2ab88e659437a0a3d58e9054abe /server/test/completion/init.lua
parent2c5cfd138ace486e36960a018e39d1b9c52cabc1 (diff)
downloadlua-language-server-58a8a075c9a83d5356ef49c6bd6122d7387b92ae.zip
支持method和documentation
Diffstat (limited to 'server/test/completion/init.lua')
-rw-r--r--server/test/completion/init.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua
index 31021fac..c0ce7076 100644
--- a/server/test/completion/init.lua
+++ b/server/test/completion/init.lua
@@ -29,7 +29,12 @@ local CompletionItemKind = {
TypeParameter = 25,
}
+local EXISTS = {}
+
local function eq(a, b)
+ if a == EXISTS and b ~= nil then
+ return true
+ end
local tp1, tp2 = type(a), type(b)
if tp1 ~= tp2 then
return false
@@ -136,6 +141,7 @@ a@
{
label = 'assert',
kind = CompletionItemKind.Function,
+ documentation = EXISTS,
}
}
@@ -164,3 +170,18 @@ z@
detail = 'zabc = 1',
}
}
+
+TEST [[
+local mt = {}
+function mt:get(a, b)
+ return 1
+end
+mt:g@
+]]
+{
+ {
+ label = 'get',
+ kind = CompletionItemKind.Method,
+ documentation = EXISTS,
+ }
+}