(lua) types are now guessed for type annotations

This made me to do small adjustments to the tree extractor, and it now
can retrieve fixed positions from the tree. If no node_type name is
specified, it will put all nodes fetched from fixed positions to ["_"]
= values
This commit is contained in:
Daniel Mathiot
2021-08-26 12:28:46 +02:00
parent d90b697104
commit fddd50553e
4 changed files with 68 additions and 31 deletions

View File

@@ -16,9 +16,9 @@ local function_tree = {
}
return {
parent = {
func = { "function_declaration", "expression_statement", "variable_declaration" },
class = { "function_declaration", "expression_statement", "variable_declaration", "class_declaration" },
parent = {
func = { "function_declaration", "expression_statement", "variable_declaration" },
class = { "function_declaration", "expression_statement", "variable_declaration", "class_declaration" },
},
data = {
@@ -64,7 +64,7 @@ return {
end,
},
},
}
},
},
template = {
@@ -74,7 +74,7 @@ return {
jsdoc = {
{ nil, "/* */", { no_results = true } },
{ nil, "/**" },
{ "class_tag", " * @classdesc" , { before_first_item = { " * ", " * @class" } }},
{ "class_tag", " * @classdesc", { before_first_item = { " * ", " * @class" } } },
{ "parameters", " * @param {any} %s " },
{ "return_statement", " * @returns {any} " },
{ nil, " */" },