MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / ruby_enclosing_call

Function ruby_enclosing_call

codegraph-kernel/src/ruby.rs:1187–1197  ·  view source on GitHub ↗

The Ruby `call` node whose argument_list (or keyword pair) contains `node` — nearest `call` ancestor within 4 parent hops (function-ref.ts:837).

(node: Node)

Source from the content-addressed store, hash-verified

1185/// The Ruby `call` node whose argument_list (or keyword pair) contains `node`
1186/// — nearest `call` ancestor within 4 parent hops (function-ref.ts:837).
1187fn ruby_enclosing_call(node: Node) -> Option<Node> {
1188 let mut cur = node.parent();
1189 for _ in 0..4 {
1190 let c = cur?;
1191 if c.kind() == "call" {
1192 return Some(c);
1193 }
1194 cur = c.parent();
1195 }
1196 None
1197}
1198
1199fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef {
1200 match s {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected