Feature/improve jsdoc (#210)
* search identifiers recursively to get assignments identifiers * improves jsdoc template
This commit is contained in:
@@ -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 },
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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" } } },
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user