From 00dd1ed171beda2e892a2460d6e7eff321c775e8 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, 8 Nov 2022 00:01:12 +0800 Subject: support enums with runtime values resolved #1411 --- test/completion/common.lua | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'test/completion') diff --git a/test/completion/common.lua b/test/completion/common.lua index dab31c31..b73543fb 100644 --- a/test/completion/common.lua +++ b/test/completion/common.lua @@ -3781,6 +3781,40 @@ f() }, } +TEST [[ +local x = 1 +local y = 2 + +---@enum Enum +local t = { + x = x, + y = y, +} + +---@param p Enum +local function f(p) end + +f() +]] +{ + { + label = 't.x', + kind = define.CompletionItemKind.EnumMember, + }, + { + label = 't.y', + kind = define.CompletionItemKind.EnumMember, + }, + { + label = '1', + kind = define.CompletionItemKind.EnumMember, + }, + { + label = '2', + kind = define.CompletionItemKind.EnumMember, + }, +} + TEST [[ -- -- cgit v1.2.3