summaryrefslogtreecommitdiff
path: root/test/completion
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-11-08 00:01:12 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-11-08 00:01:12 +0800
commit00dd1ed171beda2e892a2460d6e7eff321c775e8 (patch)
tree95a17424f070cc6d0ee7d458011519c82039a378 /test/completion
parent34d32a478bcd066baf49ccf36f5f26a132cbfab8 (diff)
downloadlua-language-server-00dd1ed171beda2e892a2460d6e7eff321c775e8.zip
support enums with runtime values
resolved #1411
Diffstat (limited to 'test/completion')
-rw-r--r--test/completion/common.lua34
1 files changed, 34 insertions, 0 deletions
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
@@ -3782,6 +3782,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 [[
--
<??>
]]