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

Method scan_fn_ref_subtree

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

Source from the content-addressed store, hash-verified

1499 }
1500
1501 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32, walked: &HashSet<usize>) {
1502 stack_guard!();
1503 if depth > 12 {
1504 return;
1505 }
1506 // Subtrees the body walker has already been through.
1507 if walked.contains(&node.id()) {
1508 return;
1509 }
1510 if depth > 0
1511 && matches!(
1512 node.kind(),
1513 "function_item" | "function_signature_item" | "arrow_function"
1514 | "function_expression" | "lambda_literal" | "lambda_expression"
1515 )
1516 {
1517 return;
1518 }
1519 self.maybe_capture_fn_refs(node);
1520 for c in node.named_children(&mut node.walk()) {
1521 self.scan_fn_ref_subtree(c, depth + 1, walked);
1522 }
1523 }
1524
1525 fn flush_fn_ref_candidates(&mut self) {
1526 let mut 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