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

Method scan_fn_ref_subtree

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

Source from the content-addressed store, hash-verified

2432 }
2433
2434 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
2435 stack_guard!();
2436 if depth > 12 {
2437 return;
2438 }
2439 // Halt list: functionTypes (function_signature) + the lambda kinds —
2440 // function_expression IS dart's lambda, so constant-initializer
2441 // lambdas don't leak candidates.
2442 if depth > 0
2443 && matches!(
2444 node.kind(),
2445 "function_signature" | "arrow_function" | "function_expression"
2446 | "lambda_literal" | "lambda_expression"
2447 )
2448 {
2449 return;
2450 }
2451 self.maybe_capture_fn_refs(node);
2452 let mut cursor = node.walk();
2453 let children: Vec<Node<'t>> = node.named_children(&mut cursor).collect();
2454 for c in children {
2455 self.scan_fn_ref_subtree(c, depth + 1);
2456 }
2457 }
2458
2459 fn flush_fn_ref_candidates(&mut self) {
2460 let cands = std::mem::take(&mut self.fn_ref_cands);

Callers 1

visitMethod · 0.45

Calls 3

walkMethod · 0.80
maybe_capture_fn_refsMethod · 0.45
collectMethod · 0.45

Tested by

no test coverage detected