diff options
Diffstat (limited to 'test/completion')
-rw-r--r-- | test/completion/init.lua | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/completion/init.lua b/test/completion/init.lua index 2c1a4570..bd3aca25 100644 --- a/test/completion/init.lua +++ b/test/completion/init.lua @@ -2139,6 +2139,27 @@ x.a = $ 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 = $ } @@ -2157,3 +2178,24 @@ local x = { 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, + }, +} |