summaryrefslogtreecommitdiff
path: root/test/completion
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-08-16 17:04:25 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-08-16 17:04:25 +0800
commitbe5b77b7956970647d4d12d0e83ccf9bb410565b (patch)
treed5a1e94e71b309524da9f6a4a9fa23c5e2f077b4 /test/completion
parentb53c18f1fe69c07c65378892ea42346c593f5023 (diff)
downloadlua-language-server-be5b77b7956970647d4d12d0e83ccf9bb410565b.zip
supports `---@enum (key)`
Diffstat (limited to 'test/completion')
-rw-r--r--test/completion/common.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua
index e33b2a1b..bd317259 100644
--- a/test/completion/common.lua
+++ b/test/completion/common.lua
@@ -3816,6 +3816,32 @@ f(<??>)
}
TEST [[
+local x = 1
+local y = 2
+
+---@enum(key) Enum
+local t = {
+ x = x,
+ y = y,
+}
+
+---@param p Enum
+local function f(p) end
+
+f(<??>)
+]]
+{
+ {
+ label = '"x"',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = '"y"',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+}
+
+TEST [[
--
<??>
]]