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

Method scan_fn_ref_subtree

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

Source from the content-addressed store, hash-verified

981 }
982
983 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
984 stack_guard!();
985 if depth > 12 {
986 return;
987 }
988 // Halts at functionTypes (`method`) + the fixed arrow/lambda list;
989 // NOT at class/module nodes — the module multiply-capture rides this.
990 if depth > 0
991 && matches!(
992 node.kind(),
993 "method" | "arrow_function" | "function_expression" | "lambda_literal"
994 | "lambda_expression"
995 )
996 {
997 return;
998 }
999 self.maybe_capture_fn_refs(node);
1000 for i in 0..node.named_child_count() {
1001 if let Some(c) = node.named_child(i) {
1002 self.scan_fn_ref_subtree(c, depth + 1);
1003 }
1004 }
1005 }
1006
1007 fn flush_fn_ref_candidates(&mut self) {
1008 let cands = std::mem::take(&mut self.fn_ref_cands);

Callers 1

visit_nodeMethod · 0.45

Calls 1

maybe_capture_fn_refsMethod · 0.45

Tested by

no test coverage detected