Feature/improve jsdoc (#210)

* search identifiers recursively to get assignments identifiers

* improves jsdoc template
This commit is contained in:
Jed
2025-02-19 11:51:09 +01:00
committed by GitHub
parent d633d2ef57
commit bc2325419e
2 changed files with 4 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ local function_tree = {
retrieve = "first",
node_type = "formal_parameters",
subtree = {
{ retrieve = "all", node_type = "identifier", extract = true, as = i.Parameter },
{ retrieve = "all", node_type = "identifier", recursive = true, extract = true, as = i.Parameter },
},
},
{

View File

@@ -10,12 +10,12 @@ return {
{ nil, "/**", { type = { "class", "func" } } },
{ i.ClassName, " * @classdesc $1", { before_first_item = { " * ", " * @class" }, type = { "class" } } },
{ i.Parameter, " * @param {any} %s $1", { type = { "func" } } },
{ i.Parameter, " * @param {$1} %s - $1", { type = { "func" } } },
{
{ i.Type, i.Parameter },
" * @param {%s} %s $1",
" * @param {%s} %s - $1",
{ required = i.Tparam, type = { "func" } },
},
{ i.Return, " * @returns {$1} $1", { type = { "func" } } },
{ i.Return, " * @returns {$1} - $1", { type = { "func" } } },
{ nil, " */", { type = { "class", "func" } } },
}