feat(ts) Add support for @template (#79)
This commit is contained in:
@@ -52,6 +52,18 @@ local function_tree = {
|
|||||||
{ retrieve = "all", node_type = "type_identifier", extract = true, as = i.Return },
|
{ retrieve = "all", node_type = "type_identifier", extract = true, as = i.Return },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
retrieve = "first",
|
||||||
|
node_type = "type_parameters",
|
||||||
|
subtree = {
|
||||||
|
{
|
||||||
|
retrieve = "all",
|
||||||
|
node_type = "type_parameter",
|
||||||
|
extract = true,
|
||||||
|
as = i.Type,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -165,5 +177,5 @@ return {
|
|||||||
|
|
||||||
locator = require("neogen.locators.typescript"),
|
locator = require("neogen.locators.typescript"),
|
||||||
|
|
||||||
template = template:add_default_annotation("jsdoc"):add_annotation("tsdoc"),
|
template = template:add_default_annotation("tsdoc")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ return {
|
|||||||
|
|
||||||
{ nil, "/**", { type = { "class", "func" } } },
|
{ nil, "/**", { type = { "class", "func" } } },
|
||||||
{ i.ClassName, " * $1", { type = { "class" } } },
|
{ i.ClassName, " * $1", { type = { "class" } } },
|
||||||
|
{ i.Type, " * @template %s - $1", { type = { "func" } } },
|
||||||
{ i.Parameter, " * @param %s - $1", { type = { "func" } } },
|
{ i.Parameter, " * @param %s - $1", { type = { "func" } } },
|
||||||
{
|
{
|
||||||
{ i.Parameter },
|
{ i.Parameter },
|
||||||
|
|||||||
Reference in New Issue
Block a user