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

Method scan_fn_ref_subtree

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

Source from the content-addressed store, hash-verified

1443 }
1444
1445 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
1446 stack_guard!();
1447 if depth > 12 {
1448 return;
1449 }
1450 // Halts at functionTypes (function_declaration) + the fixed list —
1451 // lambda_literal IS in it (closures halt the scan).
1452 if depth > 0
1453 && matches!(
1454 node.kind(),
1455 "function_declaration" | "arrow_function" | "function_expression" | "lambda_literal"
1456 | "lambda_expression"
1457 )
1458 {
1459 return;
1460 }
1461 self.maybe_capture_fn_refs(node);
1462 for c in node.named_children(&mut node.walk()) {
1463 self.scan_fn_ref_subtree(c, depth + 1);
1464 }
1465 }
1466
1467 fn flush_fn_ref_candidates(&mut self) {
1468 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