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

Method scan_fn_ref_subtree

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

Source from the content-addressed store, hash-verified

1281 }
1282
1283 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
1284 stack_guard!();
1285 if depth > 12 {
1286 return;
1287 }
1288 if depth > 0
1289 && matches!(
1290 node.kind(),
1291 "function_item" | "function_signature_item" | "arrow_function"
1292 | "function_expression" | "lambda_literal" | "lambda_expression"
1293 )
1294 {
1295 return;
1296 }
1297 self.maybe_capture_fn_refs(node);
1298 for i in 0..node.named_child_count() {
1299 if let Some(c) = node.named_child(i) {
1300 self.scan_fn_ref_subtree(c, depth + 1);
1301 }
1302 }
1303 }
1304
1305 fn flush_fn_ref_candidates(&mut self) {
1306 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