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

Method scan_fn_ref_subtree

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

Source from the content-addressed store, hash-verified

1294 }
1295
1296 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
1297 if depth > 12 {
1298 return;
1299 }
1300 // Halt list: functionTypes is EMPTY for scala, so only the literal
1301 // lambda kinds halt — the scan descends into nested
1302 // function_definitions inside hook-consumed vals.
1303 if depth > 0
1304 && matches!(
1305 node.kind(),
1306 "arrow_function" | "function_expression" | "lambda_literal" | "lambda_expression"
1307 )
1308 {
1309 return;
1310 }
1311 self.maybe_capture_fn_refs(node);
1312 let mut cursor = node.walk();
1313 let children: Vec<Node<'t>> = node.named_children(&mut cursor).collect();
1314 for c in children {
1315 self.scan_fn_ref_subtree(c, depth + 1);
1316 }
1317 }
1318
1319 fn flush_fn_ref_candidates(&mut self) {
1320 let cands = std::mem::take(&mut self.fn_ref_cands);

Callers 1

visitMethod · 0.45

Calls 2

maybe_capture_fn_refsMethod · 0.45
collectMethod · 0.45

Tested by

no test coverage detected