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

Function ruby_enclosing_call

codegraph-kernel/src/ruby.rs:1195–1205  ·  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

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected