summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/completion/common.lua21
-rw-r--r--test/definition/luadoc.lua30
2 files changed, 51 insertions, 0 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua
index 90037c27..3ea02ed7 100644
--- a/test/completion/common.lua
+++ b/test/completion/common.lua
@@ -4413,3 +4413,24 @@ new 'A' {
kind = define.CompletionItemKind.Property,
}
}
+
+TEST [[
+---@class namespace.A
+---@overload fun(x: {id: string})
+
+---@generic T
+---@param t namespace.`T`
+---@return T
+local function new(t) end
+
+new 'A' {
+ <??>
+}
+]]
+{
+ {
+ label = 'id',
+ kind = define.CompletionItemKind.Property,
+ }
+}
+
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