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

Method scan_fn_ref_subtree

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

Source from the content-addressed store, hash-verified

2411 }
2412
2413 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
2414 stack_guard!();
2415 if depth > 12 {
2416 return;
2417 }
2418 // Halt list: functionTypes (function_signature) + the lambda kinds —
2419 // function_expression IS dart's lambda, so constant-initializer
2420 // lambdas don't leak candidates.
2421 if depth > 0
2422 && matches!(
2423 node.kind(),
2424 "function_signature" | "arrow_function" | "function_expression"
2425 | "lambda_literal" | "lambda_expression"
2426 )
2427 {
2428 return;
2429 }
2430 self.maybe_capture_fn_refs(node);
2431 let mut cursor = node.walk();
2432 let children: Vec<Node<'t>> = node.named_children(&mut cursor).collect();
2433 for c in children {
2434 self.scan_fn_ref_subtree(c, depth + 1);
2435 }
2436 }
2437
2438 fn flush_fn_ref_candidates(&mut self) {
2439 let cands = std::mem::take(&mut self.fn_ref_cands);

Callers 1

visitMethod · 0.45

Calls 3

maybe_capture_fn_refsMethod · 0.45
walkMethod · 0.45
collectMethod · 0.45

Tested by

no test coverage detected