summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-06 19:43:43 +0800
committersumneko <sumneko@hotmail.com>2019-05-06 19:43:43 +0800
commitce0e466279ccd237ec8b3df5e7ed9275b166e1c7 (patch)
tree765108bf350103345f4538b73e237bf016fce660 /server/test
parentdf62d7a467cc2ffa1d4945c4912a4568baf75847 (diff)
downloadlua-language-server-ce0e466279ccd237ec8b3df5e7ed9275b166e1c7.zip
param支持字面量
Diffstat (limited to 'server/test')
-rw-r--r--server/test/completion/init.lua44
1 files changed, 44 insertions, 0 deletions
diff --git a/server/test/completion/init.lua b/server/test/completion/init.lua
index 17ab0369..de924bd7 100644
--- a/server/test/completion/init.lua
+++ b/server/test/completion/init.lua
@@ -1055,3 +1055,47 @@ end
kind = CompletionItemKind.Keyword,
},
}
+
+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,
+ }
+}