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

Method scan_fn_ref_subtree

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

Source from the content-addressed store, hash-verified

1395 }
1396
1397 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
1398 stack_guard!();
1399 if depth > 12 {
1400 return;
1401 }
1402 // Halts at functionTypes (function_declaration) + the fixed list —
1403 // lambda_literal IS in it (closures halt the scan).
1404 if depth > 0
1405 && matches!(
1406 node.kind(),
1407 "function_declaration" | "arrow_function" | "function_expression" | "lambda_literal"
1408 | "lambda_expression"
1409 )
1410 {
1411 return;
1412 }
1413 self.maybe_capture_fn_refs(node);
1414 for i in 0..node.named_child_count() {
1415 if let Some(c) = node.named_child(i) {
1416 self.scan_fn_ref_subtree(c, depth + 1);
1417 }
1418 }
1419 }
1420
1421 fn flush_fn_ref_candidates(&mut self) {
1422 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