diff --git a/lua/neogen/configurations/java.lua b/lua/neogen/configurations/java.lua index aa51680..f703bd7 100644 --- a/lua/neogen/configurations/java.lua +++ b/lua/neogen/configurations/java.lua @@ -19,7 +19,9 @@ local function_tree = { { retrieve = "all", node_type = "throws", - extract = true, + subtree = { + { retrieve = "all",node_type= "type_identifier", extract = true, as="throw_statement"} + } }, { retrieve = "first", @@ -65,11 +67,7 @@ return { local nodes = nodes_utils:matching_nodes_from(node, tree) local res = extractors:extract_from_matched(nodes) - if res.throws then - results.throw_statement = res.throws - else - results.throw_statement = res.throw_statement - end + results.throw_statement = res.throw_statement results.parameters = res.identifier return results end, diff --git a/lua/neogen/templates/javadoc.lua b/lua/neogen/templates/javadoc.lua index 65ad272..c97ee54 100644 --- a/lua/neogen/templates/javadoc.lua +++ b/lua/neogen/templates/javadoc.lua @@ -11,6 +11,6 @@ return { { i.Parameter, " * @param %s $1" }, { i.ClassAttribute, " * @property %s $1" }, { i.Return, " * @return $1" }, - { i.Throw, " * @throws $1" }, + { i.Throw, " * @throws %s $1" }, { nil, " */" }, }