From 025c4c5fb2ced70e448716391be70fc47e82b1fb 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 16:27:49 +0800 Subject: completion: supports enums in `fun()` --- test/completion/init.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'test') diff --git a/test/completion/init.lua b/test/completion/init.lua index ea1cdfdb..1ed82b2a 100644 --- a/test/completion/init.lua +++ b/test/completion/init.lua @@ -2696,3 +2696,30 @@ local r = f('$') }, }, } + +TEST [[ +---@type fun(x: "'aaa'"|"'bbb'") +local f + +f('$') +]] +{ + { + label = "'aaa'", + kind = define.CompletionItemKind.EnumMember, + textEdit = { + newText = "'aaa'", + start = 45, + finish = 46, + }, + }, + { + label = "'bbb'", + kind = define.CompletionItemKind.EnumMember, + textEdit = { + newText = "'bbb'", + start = 45, + finish = 46, + }, + }, +} -- cgit v1.2.3