diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/completion/init.lua | 90 |
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, + }, +} |