summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-03-07 19:46:14 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-03-07 19:46:14 +0800
commitf5f0620a09708c07acbb024a0a98bd8595658116 (patch)
tree197d68944ec38099a5d1d611545d316180b7335d /test
parentd10e3b99be56ed6ae598a2c13892324f6994fb5c (diff)
downloadlua-language-server-f5f0620a09708c07acbb024a0a98bd8595658116.zip
update
Diffstat (limited to 'test')
-rw-r--r--test/definition/luadoc.lua42
1 files changed, 24 insertions, 18 deletions
diff --git a/test/definition/luadoc.lua b/test/definition/luadoc.lua
index 592cbef7..ff54f0ed 100644
--- a/test/definition/luadoc.lua
+++ b/test/definition/luadoc.lua
@@ -143,6 +143,20 @@ function f(<?...?>) end
]]
TEST [[
+---@alias A <!fun()!>
+
+---@type A
+local <!<?x?>!>
+]]
+
+TEST [[
+---@class A: <!{}!>
+
+---@type A
+local <!<?x?>!>
+]]
+
+TEST [[
---@overload <!fun(y: boolean)!>
---@param x number
---@param y boolean
@@ -602,39 +616,31 @@ end
]]
TEST [[
----@class C
-local <!v!>
+---@alias C <!fun()!>
----@type C
-local <!v1!>
+---@type C[]
+local v1
---@generic V, T
---@param t T
----@return fun(t: V): V
+---@return fun(t: V[]): V
---@return T
local function iterator(t) end
-for <!v!> in iterator(<!v1!>) do
+for <!v!> in iterator(v1) do
print(<?v?>)
end
]]
TEST [[
----@class C
-local <!v!>
+---@class TT<V>: { x: V }
----@type C[]
-local v1
+---@type TT<A>
+local t
----@generic V, T
----@param t T
----@return fun(t: V[]): V
----@return T
-local function iterator(t) end
+---@class A: <!{}!>
-for <!v!> in iterator(v1) do
- print(<?v?>)
-end
+print(t.<?x?>)
]]
TEST [[