diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2024-06-05 18:37:24 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2024-06-05 18:37:24 +0800 |
commit | c0de8e657bf8685691078b6a367a03a46997bf9c (patch) | |
tree | 734badf1ca90f22e116e108291752bda74526761 /test/completion | |
parent | 9498df4eee86545ac29df2ff3d701e57448585ad (diff) | |
download | lua-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.lua | 30 |
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, } } - |