summaryrefslogtreecommitdiff
path: root/server/test/hover/init.lua
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-30 17:16:13 +0800
committersumneko <sumneko@hotmail.com>2019-04-30 17:16:13 +0800
commite683d90bdb40ed07ad3f1b53ca94b0d299382c74 (patch)
treef6c7f1d8d7906ab6f962ce0660248f0ebf94ba75 /server/test/hover/init.lua
parentcf97b3bf418d73894bb7849b6c02e40c753425bb (diff)
downloadlua-language-server-e683d90bdb40ed07ad3f1b53ca94b0d299382c74.zip
emmyTableType
Diffstat (limited to 'server/test/hover/init.lua')
-rw-r--r--server/test/hover/init.lua49
1 files changed, 49 insertions, 0 deletions
diff --git a/server/test/hover/init.lua b/server/test/hover/init.lua
index 485b68a7..685ee507 100644
--- a/server/test/hover/init.lua
+++ b/server/test/hover/init.lua
@@ -691,3 +691,52 @@ end
[[
local k: integer
]]
+
+TEST [[
+---@type table<ClassA, ClassB>
+local <?x?>
+]]
+[[
+local x: {
+ [*ClassA]: ClassB,
+}
+]]
+
+TEST [[
+---@type string[]
+local t
+local <?x?> = t[1]
+]]
+[[
+local x: string
+]]
+
+TEST [[
+---@type string[]
+local t
+for _, <?x?> in ipairs(t) do
+end
+]]
+[[
+local x: string
+]]
+
+TEST [[
+---@type string[]
+local t
+for _, <?x?> in pairs(t) do
+end
+]]
+[[
+local x: string
+]]
+
+TEST [[
+---@type string[]
+local t
+for <?k?>, v in pairs(t) do
+end
+]]
+[[
+local k: integer
+]]