summaryrefslogtreecommitdiff
path: root/test/completion/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/completion/init.lua')
-rw-r--r--test/completion/init.lua42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/completion/init.lua b/test/completion/init.lua
index 5f79ea21..2c1a4570 100644
--- a/test/completion/init.lua
+++ b/test/completion/init.lua
@@ -2115,3 +2115,45 @@ field cc.aaa: number
},
}
Cared['description'] = nil
+
+TEST [[
+---@type table<string, "'a'"|"'b'"|"'c'">
+local x
+
+x.a = $
+]]
+{
+ {
+ label = "'a'",
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = "'b'",
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = "'c'",
+ kind = define.CompletionItemKind.EnumMember,
+ },
+}
+
+TEST [[
+---@type table<string, "'a'"|"'b'"|"'c'">
+local x = {
+ a = $
+}
+]]
+{
+ {
+ label = "'a'",
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = "'b'",
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = "'c'",
+ kind = define.CompletionItemKind.EnumMember,
+ },
+}