summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-30 17:23:42 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-30 17:23:42 +0800
commit8785f527f209607a3efe6c2762f6096b9cb14853 (patch)
tree7cbd3d3563e3d1e407da7b315184c9e95ff54dba /test
parent26facefa5de1ed0c71071110535d86b1b5c2fc1c (diff)
downloadlua-language-server-8785f527f209607a3efe6c2762f6096b9cb14853.zip
completion by enum
Diffstat (limited to 'test')
-rw-r--r--test/completion/init.lua90
1 files changed, 90 insertions, 0 deletions
diff --git a/test/completion/init.lua b/test/completion/init.lua
index b5eac60b..ab4a7b8a 100644
--- a/test/completion/init.lua
+++ b/test/completion/init.lua
@@ -1784,3 +1784,93 @@ utf8.charpatter$
description = EXISTS,
}
}
+
+TEST [[
+---@type "'a'"|"'b'"|"'c'"
+local x
+
+print(x == $)
+]]
+{
+ {
+ label = "'a'",
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = "'b'",
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = "'c'",
+ kind = define.CompletionItemKind.EnumMember,
+ },
+}
+
+TEST [[
+---@type "'a'"|"'b'"|"'c'"
+local x
+
+x = $
+]]
+{
+ {
+ label = "'a'",
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = "'b'",
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = "'c'",
+ kind = define.CompletionItemKind.EnumMember,
+ },
+}
+
+TEST [[
+---@type "'a'"|"'b'"|"'c'"
+local x
+
+print(x == '$')
+]]
+{
+ {
+ label = "'a'",
+ kind = define.CompletionItemKind.EnumMember,
+ textEdit = EXISTS,
+ },
+ {
+ label = "'b'",
+ kind = define.CompletionItemKind.EnumMember,
+ textEdit = EXISTS,
+ },
+ {
+ label = "'c'",
+ kind = define.CompletionItemKind.EnumMember,
+ textEdit = EXISTS,
+ },
+}
+
+TEST [[
+---@type "'a'"|"'b'"|"'c'"
+local x
+
+x = '$'
+]]
+{
+ {
+ label = "'a'",
+ kind = define.CompletionItemKind.EnumMember,
+ textEdit = EXISTS,
+ },
+ {
+ label = "'b'",
+ kind = define.CompletionItemKind.EnumMember,
+ textEdit = EXISTS,
+ },
+ {
+ label = "'c'",
+ kind = define.CompletionItemKind.EnumMember,
+ textEdit = EXISTS,
+ },
+}