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

Method scan_fn_ref_subtree

codegraph-kernel/src/go.rs:1294–1318  ·  view source on GitHub ↗
(&mut self, node: Node<'t>, depth: u32, walked: &[usize])

Source from the content-addressed store, hash-verified

1292 }
1293
1294 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32, walked: &[usize]) {
1295 stack_guard!();
1296 if depth > 12 {
1297 return;
1298 }
1299 // Subtrees the body walker has already been through.
1300 if walked.contains(&node.id()) {
1301 return;
1302 }
1303 if depth > 0
1304 && matches!(
1305 node.kind(),
1306 "function_declaration" | "arrow_function" | "function_expression"
1307 | "lambda_literal" | "lambda_expression"
1308 )
1309 {
1310 return;
1311 }
1312 self.maybe_capture_fn_refs(node);
1313 for i in 0..node.named_child_count() {
1314 if let Some(c) = node.named_child(i) {
1315 self.scan_fn_ref_subtree(c, depth + 1, walked);
1316 }
1317 }
1318 }
1319
1320 fn flush_fn_ref_candidates(&mut self) {
1321 let cands = std::mem::take(&mut self.fn_ref_cands);

Callers 1

visit_nodeMethod · 0.45

Calls 2

idMethod · 0.80
maybe_capture_fn_refsMethod · 0.45

Tested by

no test coverage detected