summaryrefslogtreecommitdiff
path: root/test/completion
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-16 15:18:20 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-16 15:18:20 +0800
commit05c0b9a8894bb1c24a24e2ed26e61a3b47d12d89 (patch)
treeb65bf33233db955a70dee0896963a79fd934f71a /test/completion
parent3ed6ac9ef23c26371bd3ccb694e45ed3a99105b3 (diff)
downloadlua-language-server-05c0b9a8894bb1c24a24e2ed26e61a3b47d12d89.zip
fix enum completion
Diffstat (limited to 'test/completion')
-rw-r--r--test/completion/init.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/completion/init.lua b/test/completion/init.lua
index 9c87ab33..ea1cdfdb 100644
--- a/test/completion/init.lua
+++ b/test/completion/init.lua
@@ -2665,3 +2665,34 @@ t.$
},
}
}
+
+TEST [[
+---@alias enum '"aaa"'|'"bbb"'
+
+---@param x enum
+---@return enum
+local function f(x)
+end
+
+local r = f('$')
+]]
+{
+ {
+ label = "'aaa'",
+ kind = define.CompletionItemKind.EnumMember,
+ textEdit = {
+ newText = "'aaa'",
+ start = 103,
+ finish = 104,
+ },
+ },
+ {
+ label = "'bbb'",
+ kind = define.CompletionItemKind.EnumMember,
+ textEdit = {
+ newText = "'bbb'",
+ start = 103,
+ finish = 104,
+ },
+ },
+}