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

Method scan_fn_ref_subtree

codegraph-kernel/src/rustlang.rs:1476–1498  ·  view source on GitHub ↗
(&mut self, node: Node<'t>, depth: u32, walked: &HashSet<usize>)

Source from the content-addressed store, hash-verified

1474 }
1475
1476 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32, walked: &HashSet<usize>) {
1477 stack_guard!();
1478 if depth > 12 {
1479 return;
1480 }
1481 // Subtrees the body walker has already been through.
1482 if walked.contains(&node.id()) {
1483 return;
1484 }
1485 if depth > 0
1486 && matches!(
1487 node.kind(),
1488 "function_item" | "function_signature_item" | "arrow_function"
1489 | "function_expression" | "lambda_literal" | "lambda_expression"
1490 )
1491 {
1492 return;
1493 }
1494 self.maybe_capture_fn_refs(node);
1495 for c in node.named_children(&mut node.walk()) {
1496 self.scan_fn_ref_subtree(c, depth + 1, walked);
1497 }
1498 }
1499
1500 fn flush_fn_ref_candidates(&mut self) {
1501 let cands = std::mem::take(&mut self.fn_ref_cands);

Callers 1

visit_nodeMethod · 0.45

Calls 3

idMethod · 0.80
maybe_capture_fn_refsMethod · 0.45
walkMethod · 0.45

Tested by

no test coverage detected