summaryrefslogtreecommitdiff
path: root/test/definition
diff options
context:
space:
mode:
authorfesily <fesil@foxmail.com>2024-01-17 15:00:54 +0800
committerfesily <fesil@foxmail.com>2024-01-17 15:00:54 +0800
commit1e51dd0617a9ae55703700550b6db211080a8c13 (patch)
treeda8e68fa128b106a32f0ff28cc393f66f3ac381a /test/definition
parent4432dfea0fe8390be166b832a1ac416c8228296f (diff)
downloadlua-language-server-1e51dd0617a9ae55703700550b6db211080a8c13.zip
doc param support generic pattern
Diffstat (limited to 'test/definition')
-rw-r--r--test/definition/luadoc.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/definition/luadoc.lua b/test/definition/luadoc.lua
index b877f5cd..7a460593 100644
--- a/test/definition/luadoc.lua
+++ b/test/definition/luadoc.lua
@@ -304,6 +304,21 @@ local v1 = Generic(Foo)
print(v1.<?bar1?>)
]]
+
+TEST [[
+---@class n.Foo
+local Foo = {}
+function Foo:bar1() end
+
+---@generic T
+---@param arg1 n.`T`
+---@return T
+function Generic(arg1) print(arg1) end
+
+local v1 = Generic(Foo)
+print(v1.<?bar1?>)
+]]
+
TEST [[
---@class Foo
local Foo = {}
@@ -318,6 +333,21 @@ local v1 = Generic("Foo")
print(v1.<?bar1?>)
]]
+
+TEST [[
+---@class n.Foo
+local Foo = {}
+function Foo:<!bar1!>() end
+
+---@generic T
+---@param arg1 n.`T`
+---@return T
+function Generic(arg1) print(arg1) end
+
+local v1 = Generic("Foo")
+print(v1.<?bar1?>)
+]]
+
TEST [[
---@class A
local t