summaryrefslogtreecommitdiff
path: root/test/completion
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-03-17 11:18:19 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-03-17 11:18:19 +0800
commit55380a91e9a6d7fe4bbaeddc4b649822183a0db8 (patch)
tree1993e903e557a318005206ad3b558e89d7b58ab4 /test/completion
parent268cfa9dd50292269c4c3bcc40093b54c6727bfa (diff)
downloadlua-language-server-55380a91e9a6d7fe4bbaeddc4b649822183a0db8.zip
completion: field in table
Diffstat (limited to 'test/completion')
-rw-r--r--test/completion/init.lua61
1 files changed, 40 insertions, 21 deletions
diff --git a/test/completion/init.lua b/test/completion/init.lua
index 89cad975..38d85132 100644
--- a/test/completion/init.lua
+++ b/test/completion/init.lua
@@ -2374,24 +2374,43 @@ f(1, {}, {}, {
}
}
---TEST [[
------@class C
------@field x number
------@field y number
---
------@type C
---local t = {
--- $
---}
---
---]]
---{
--- {
--- label = 'x',
--- kind = define.CompletionItemKind.Property,
--- },
--- {
--- label = 'y',
--- kind = define.CompletionItemKind.Property,
--- }
---}
+TEST [[
+---@class C
+---@field x number
+---@field y number
+
+---@type C
+local t = {
+ $
+}
+
+]]
+{
+ {
+ label = 'x',
+ kind = define.CompletionItemKind.Property,
+ },
+ {
+ label = 'y',
+ kind = define.CompletionItemKind.Property,
+ }
+}
+
+TEST [[
+---@class C
+---@field x number
+---@field y number
+
+---@type C
+local t = {
+ x$
+}
+
+]]
+{
+ include = true,
+ {
+ label = 'x',
+ kind = define.CompletionItemKind.Property,
+ },
+}