diff --git a/lua/neogen/configurations/c.lua b/lua/neogen/configurations/c.lua index 64c5d62..393246b 100644 --- a/lua/neogen/configurations/c.lua +++ b/lua/neogen/configurations/c.lua @@ -6,7 +6,7 @@ local c_params = { retrieve = "all", node_type = "parameter_declaration", subtree = { - { retrieve = "first_recursive", node_type = "identifier", extract = true} + { retrieve = "first_recursive", node_type = "identifier", extract = true }, }, }, }, @@ -23,7 +23,7 @@ local c_function_extractor = function(node) { retrieve = "first_recursive", node_type = "function_declarator", - extract = true + extract = true, }, { retrieve = "first", @@ -32,13 +32,12 @@ local c_function_extractor = function(node) { retrieve = "first", node_type = "return_statement", extract = true }, }, }, - c_params + c_params, } local nodes = neogen.utilities.nodes:matching_nodes_from(node, tree) local res = neogen.utilities.extractors:extract_from_matched(nodes) - if nodes.function_declarator then local subnodes = neogen.utilities.nodes:matching_nodes_from(nodes.function_declarator[1], tree) local subres = neogen.utilities.extractors:extract_from_matched(subnodes) diff --git a/lua/neogen/configurations/lua.lua b/lua/neogen/configurations/lua.lua index 068ac1d..b4e9975 100644 --- a/lua/neogen/configurations/lua.lua +++ b/lua/neogen/configurations/lua.lua @@ -124,5 +124,11 @@ return { { "class_name", "- @class $1|any" }, { "type", "- @type %s $1" }, }, + ldoc = { + { nil, "- $1", { no_results = true, type = { "func" } } }, + { nil, "- $1", { type = { "func" } } }, + { "parameters", " @tparam $1|any %s " }, + { "return_statement", " @treturn $1|any" }, + }, }, }