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

Function ruby_enclosing_call

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

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected