From 05c0b9a8894bb1c24a24e2ed26e61a3b47d12d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 16 Jul 2021 15:18:20 +0800 Subject: fix enum completion --- test/completion/init.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'test') 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, + }, + }, +} -- cgit v1.2.3