From 6b0c48293cfbaebb375975897b59f67e1fa1df31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 11 Jun 2024 21:05:43 +0800 Subject: =?UTF-8?q?=E6=94=B9=E7=94=A8=E6=9B=B4=E5=A5=BD=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/completion/common.lua | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'test/completion') diff --git a/test/completion/common.lua b/test/completion/common.lua index fc2183d7..ec2372a0 100644 --- a/test/completion/common.lua +++ b/test/completion/common.lua @@ -4489,3 +4489,48 @@ local m m:self():optional() ]] (nil) + +TEST [[ +---@enum(key) enum +local t = { + a = 1, + b = 2, + c = 3, +} + +---@class A +local M + +---@return A +function M.create() + return M +end + +---@param optional enum +---@return self +function M:optional(optional) + return self +end + +---@return A +function M:self() + return self +end + + +M.create():optional():self() +]] +{ + { + label = '"a"', + kind = define.CompletionItemKind.EnumMember, + }, + { + label = '"b"', + kind = define.CompletionItemKind.EnumMember, + }, + { + label = '"c"', + kind = define.CompletionItemKind.EnumMember, + }, +} -- cgit v1.2.3