feat(java) Improve throws statements (#91)

This commit is contained in:
Daniel Mathiot
2022-05-05 10:18:02 +02:00
parent a4b2fd5ba5
commit 668b3ad04d
2 changed files with 5 additions and 7 deletions

View File

@@ -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.parameters = res.identifier
return results
end,

View File

@@ -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, " */" },
}