summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-15 20:04:42 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-15 20:04:42 +0800
commitc22679b21f0ed689dc269d49f05712fada02f7ce (patch)
tree8e7f0072082897fef2c5b71316eeec96a976d0d7 /test
parentd80a3db90e27f1c4598bb2bf316891857fe71bb9 (diff)
downloadlua-language-server-c22679b21f0ed689dc269d49f05712fada02f7ce.zip
resolve #589
Diffstat (limited to 'test')
-rw-r--r--test/completion/init.lua50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/completion/init.lua b/test/completion/init.lua
index 69241afd..9c87ab33 100644
--- a/test/completion/init.lua
+++ b/test/completion/init.lua
@@ -2615,3 +2615,53 @@ f(fun$)
kind = define.CompletionItemKind.Snippet,
}
}
+
+TEST [[
+---@type {[1]: number}
+local t
+
+t.$
+]]
+{
+ {
+ label = '1',
+ kind = define.CompletionItemKind.Field,
+ textEdit = {
+ newText = '[1]',
+ start = 35,
+ finish = 34,
+ },
+ additionalTextEdits = {
+ {
+ start = 34,
+ finish = 34,
+ newText = '',
+ },
+ },
+ }
+}
+
+TEST [[
+---@type {[1]: number}
+local t
+
+t.$
+]]
+{
+ {
+ label = '1',
+ kind = define.CompletionItemKind.Field,
+ textEdit = {
+ newText = '[1]',
+ start = 35,
+ finish = 34,
+ },
+ additionalTextEdits = {
+ {
+ start = 34,
+ finish = 34,
+ newText = '',
+ },
+ },
+ }
+}