summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-18 20:52:40 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-18 20:52:40 +0800
commite7996f5cb580ac65ce8cf92da153a6ab0f8af3b6 (patch)
tree42a9e4e7af19e54f720e093e056566245fa04667 /test
parent1a6e21031ba029dcff7ae4efd0b8649ba8908c77 (diff)
downloadlua-language-server-e7996f5cb580ac65ce8cf92da153a6ab0f8af3b6.zip
#1255 completion for `doc.enum`
Diffstat (limited to 'test')
-rw-r--r--test/completion/common.lua62
1 files changed, 62 insertions, 0 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua
index 98901a98..23b3eff6 100644
--- a/test/completion/common.lua
+++ b/test/completion/common.lua
@@ -3635,3 +3635,65 @@ local t = {
textEdit = EXISTS,
},
}
+
+TEST [[
+---@enum A
+T = {
+ x = 1,
+ y = 'ss',
+}
+
+---@param x A
+local function f(x) end
+
+f(<??>)
+]]
+{
+ {
+ label = 'T.x',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = 'T.y',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = '1',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = '"ss"',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+}
+
+TEST [[
+---@enum A
+local ppp = {
+ x = 1,
+ y = 'ss',
+}
+
+---@param x A
+local function f(x) end
+
+f(<??>)
+]]
+{
+ {
+ label = 'ppp.x',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = 'ppp.y',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = '1',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+ {
+ label = '"ss"',
+ kind = define.CompletionItemKind.EnumMember,
+ },
+}