summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-06 20:03:02 +0800
committersumneko <sumneko@hotmail.com>2019-05-06 20:03:02 +0800
commitaa17d5ab935f3963b6a24edb77860dc4f622e31c (patch)
treedb5c8686f0b39501418b033f236322eaa831f040 /server/test
parentce0e466279ccd237ec8b3df5e7ed9275b166e1c7 (diff)
downloadlua-language-server-aa17d5ab935f3963b6a24edb77860dc4f622e31c.zip
alias支持字面量
Diffstat (limited to 'server/test')
-rw-r--r--server/test/completion/init.lua45
1 files changed, 45 insertions, 0 deletions
diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua
index de924bd7..0d34a63b 100644
--- a/server/test/completion/init.lua
+++ b/server/test/completion/init.lua
@@ -1080,6 +1080,51 @@ f(1, $)
TEST [[
---@param x string | "'AAA'" | "'BBB'" | "'CCC'"
+function f(y, x)
+end
+
+f(1,$)
+]]
+{
+ {
+ label = "'AAA'",
+ kind = CompletionItemKind.EnumMember,
+ },
+ {
+ label = "'BBB'",
+ kind = CompletionItemKind.EnumMember,
+ },
+ {
+ label = "'CCC'",
+ kind = CompletionItemKind.EnumMember,
+ }
+}
+
+TEST [[
+---@param x string | "'AAA'" | "'BBB'" | "'CCC'"
+function f(x)
+end
+
+f($)
+]]
+{
+ {
+ label = "'AAA'",
+ kind = CompletionItemKind.EnumMember,
+ },
+ {
+ label = "'BBB'",
+ kind = CompletionItemKind.EnumMember,
+ },
+ {
+ label = "'CCC'",
+ kind = CompletionItemKind.EnumMember,
+ }
+}
+
+TEST [[
+---@alias Option string | "'AAA'" | "'BBB'" | "'CCC'"
+---@param x Option
function f(x)
end