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

Method scan_fn_ref_subtree

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

Source from the content-addressed store, hash-verified

1490 }
1491
1492 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
1493 stack_guard!();
1494 if depth > 12 {
1495 return;
1496 }
1497 // Halts at functionTypes (function_declaration) + the fixed list —
1498 // lambda_literal IS in it (closures halt the scan).
1499 if depth > 0
1500 && matches!(
1501 node.kind(),
1502 "function_declaration" | "arrow_function" | "function_expression" | "lambda_literal"
1503 | "lambda_expression"
1504 )
1505 {
1506 return;
1507 }
1508 self.maybe_capture_fn_refs(node);
1509 for i in 0..node.named_child_count() {
1510 if let Some(c) = node.named_child(i) {
1511 self.scan_fn_ref_subtree(c, depth + 1);
1512 }
1513 }
1514 }
1515
1516 fn flush_fn_ref_candidates(&mut self) {
1517 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