feat(java) Improve throws statements (#91)
This commit is contained in:
@@ -19,7 +19,9 @@ local function_tree = {
|
|||||||
{
|
{
|
||||||
retrieve = "all",
|
retrieve = "all",
|
||||||
node_type = "throws",
|
node_type = "throws",
|
||||||
extract = true,
|
subtree = {
|
||||||
|
{ retrieve = "all",node_type= "type_identifier", extract = true, as="throw_statement"}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
retrieve = "first",
|
retrieve = "first",
|
||||||
@@ -65,11 +67,7 @@ return {
|
|||||||
local nodes = nodes_utils:matching_nodes_from(node, tree)
|
local nodes = nodes_utils:matching_nodes_from(node, tree)
|
||||||
local res = extractors:extract_from_matched(nodes)
|
local res = extractors:extract_from_matched(nodes)
|
||||||
|
|
||||||
if res.throws then
|
results.throw_statement = res.throw_statement
|
||||||
results.throw_statement = res.throws
|
|
||||||
else
|
|
||||||
results.throw_statement = res.throw_statement
|
|
||||||
end
|
|
||||||
results.parameters = res.identifier
|
results.parameters = res.identifier
|
||||||
return results
|
return results
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -11,6 +11,6 @@ return {
|
|||||||
{ i.Parameter, " * @param %s $1" },
|
{ i.Parameter, " * @param %s $1" },
|
||||||
{ i.ClassAttribute, " * @property %s $1" },
|
{ i.ClassAttribute, " * @property %s $1" },
|
||||||
{ i.Return, " * @return $1" },
|
{ i.Return, " * @return $1" },
|
||||||
{ i.Throw, " * @throws $1" },
|
{ i.Throw, " * @throws %s $1" },
|
||||||
{ nil, " */" },
|
{ nil, " */" },
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user