use alloc::string::String;
use crate::query::adj_ast;
use crate::syntax::builders::method_declaration::{
build_method_declaration_node, MethodDirectChildren, MethodListChildren,
};
use crate::syntax::{SyntaxGraphArgs, SyntaxGraphError};
use crate::NodeId;
pub fn reader(
args: &mut SyntaxGraphArgs<'_>,
n_id: NodeId,
) -> Result<Option<NodeId>, SyntaxGraphError> {
let nodes = adj_ast(args.ast_graph, n_id, None, &[]);
let direct = MethodDirectChildren {
block_id: nodes.get(1).copied(),
..MethodDirectChildren::default()
};
build_method_declaration_node(
args,
n_id,
Some(String::from("ArrowMethod")),
&direct,
&MethodListChildren::default(),
None,
)
.map(Some)
}