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

Function ruby_enclosing_call

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

1112/// The Ruby `call` node whose argument_list (or keyword pair) contains `node`
1113/// — nearest `call` ancestor within 4 parent hops (function-ref.ts:837).
1114fn ruby_enclosing_call(node: Node) -> Option<Node> {
1115 let mut cur = node.parent();
1116 for _ in 0..4 {
1117 let c = cur?;
1118 if c.kind() == "call" {
1119 return Some(c);
1120 }
1121 cur = c.parent();
1122 }
1123 None
1124}
1125
1126fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef {
1127 match s {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected