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

Method scan_fn_ref_subtree

codegraph-kernel/src/ruby.rs:999–1019  ·  view source on GitHub ↗
(&mut self, node: Node<'t>, depth: u32)

Source from the content-addressed store, hash-verified

997 }
998
999 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
1000 stack_guard!();
1001 if depth > 12 {
1002 return;
1003 }
1004 // Halts at functionTypes (`method`) + the fixed arrow/lambda list;
1005 // NOT at class/module nodes — the module multiply-capture rides this.
1006 if depth > 0
1007 && matches!(
1008 node.kind(),
1009 "method" | "arrow_function" | "function_expression" | "lambda_literal"
1010 | "lambda_expression"
1011 )
1012 {
1013 return;
1014 }
1015 self.maybe_capture_fn_refs(node);
1016 for c in node.named_children(&mut node.walk()) {
1017 self.scan_fn_ref_subtree(c, depth + 1);
1018 }
1019 }
1020
1021 fn flush_fn_ref_candidates(&mut self) {
1022 let cands = std::mem::take(&mut self.fn_ref_cands);

Callers 1

visit_nodeMethod · 0.45

Calls 2

maybe_capture_fn_refsMethod · 0.45
walkMethod · 0.45

Tested by

no test coverage detected