summaryrefslogtreecommitdiff
path: root/server/test/completion
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-26 17:09:08 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-26 17:09:08 +0800
commit5a46cba0367512b65322bf64125d5b9661c869bd (patch)
treeb84e4b80fcc93db425d0e7670eaa0890b768573b /server/test/completion
parent05aabcc4c4f731bd7df2bcee03d1d51fda6aab45 (diff)
downloadlua-language-server-5a46cba0367512b65322bf64125d5b9661c869bd.zip
自动完成哈希表的键
Diffstat (limited to 'server/test/completion')
-rw-r--r--server/test/completion/init.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua
index face4216..9c2a878f 100644
--- a/server/test/completion/init.lua
+++ b/server/test/completion/init.lua
@@ -267,3 +267,33 @@ TEST [[
(EXISTS)
TEST 'local s = "a:@"' (nil)
+
+TEST [[
+local xxxx = {
+ xxyy = 1,
+ xxzz = 2,
+}
+
+local t = {
+ x@
+}
+]]
+{
+ {
+ label = 'xxxx',
+ kind = CompletionItemKind.Variable,
+ },
+ {
+ label = 'xxyy',
+ kind = CompletionItemKind.Property,
+ },
+ {
+ label = 'xxzz',
+ kind = CompletionItemKind.Property,
+ },
+ {
+ label = 'xpcall',
+ kind = CompletionItemKind.Function,
+ documentation = EXISTS,
+ }
+}