summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-14 21:02:33 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-14 21:02:33 +0800
commit834d5e70092d38c884b23fe2bc176ed06f362c69 (patch)
treeefd70348303f4d21249ffcb6e6b10779566b011c /test
parentad89a32126617db2e139edb90a4dac96bc0e0496 (diff)
downloadlua-language-server-834d5e70092d38c884b23fe2bc176ed06f362c69.zip
resolve #588
Diffstat (limited to 'test')
-rw-r--r--test/definition/table.lua6
-rw-r--r--test/hover/init.lua28
2 files changed, 33 insertions, 1 deletions
diff --git a/test/definition/table.lua b/test/definition/table.lua
index ba2d2aa3..d63cc655 100644
--- a/test/definition/table.lua
+++ b/test/definition/table.lua
@@ -157,3 +157,9 @@ end
local t = f()
t.field1.<?x?>
]]
+
+TEST [[
+local t = { <!a!> }
+
+print(t[<?1?>])
+]]
diff --git a/test/hover/init.lua b/test/hover/init.lua
index 80f6009c..18482de5 100644
--- a/test/hover/init.lua
+++ b/test/hover/init.lua
@@ -818,7 +818,11 @@ local <?t?> = {
}
]]
[[
-local t: {}
+local t: {
+ [1]: string = "aaa",
+ [2]: string = "bbb",
+ [3]: string = "ccc",
+}
]]
TEST [[
@@ -1638,3 +1642,25 @@ global a.b: {
c: integer,
}
]]
+
+TEST [[
+local <?t?> = {
+ 'a', 'b', 'c',
+ [10] = 'd',
+ x = 'e',
+ y = 'f',
+ ['z'] = 'g',
+ [3] = 'h',
+}
+]]
+[[
+local t: {
+ x: string = "e",
+ y: string = "f",
+ z: string = "g",
+ [1]: string = "a",
+ [2]: string = "b",
+ [3]: string = "c"|"h",
+ [10]: string = "d",
+}
+]]