summaryrefslogtreecommitdiff
path: root/test/completion
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2024-06-05 18:37:24 +0800
committer最萌小汐 <sumneko@hotmail.com>2024-06-05 18:37:24 +0800
commitc0de8e657bf8685691078b6a367a03a46997bf9c (patch)
tree734badf1ca90f22e116e108291752bda74526761 /test/completion
parent9498df4eee86545ac29df2ff3d701e57448585ad (diff)
downloadlua-language-server-c0de8e657bf8685691078b6a367a03a46997bf9c.zip
`FIX` Autocompletion for enum values ​​is not available in some cases
Diffstat (limited to 'test/completion')
-rw-r--r--test/completion/common.lua30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua
index 3ea02ed7..b5ffe173 100644
--- a/test/completion/common.lua
+++ b/test/completion/common.lua
@@ -3842,6 +3842,35 @@ f(<??>)
}
TEST [[
+---@class optional
+---@field enum enum
+
+---@enum(key) enum
+local t = {
+ a = 1,
+ b = 2,
+}
+
+---@param a optional
+local function f(a)
+end
+
+f {
+ enum = <??>
+}
+]]
+{
+ {
+ label = '"a"',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = '"b"',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+}
+
+TEST [[
--
<??>
]]
@@ -4433,4 +4462,3 @@ new 'A' {
kind = define.CompletionItemKind.Property,
}
}
-