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

Method scan_fn_ref_subtree

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

Source from the content-addressed store, hash-verified

1326 }
1327
1328 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
1329 stack_guard!();
1330 if depth > 12 {
1331 return;
1332 }
1333 // Halt list: functionTypes is EMPTY for scala, so only the literal
1334 // lambda kinds halt — the scan descends into nested
1335 // function_definitions inside hook-consumed vals.
1336 if depth > 0
1337 && matches!(
1338 node.kind(),
1339 "arrow_function" | "function_expression" | "lambda_literal" | "lambda_expression"
1340 )
1341 {
1342 return;
1343 }
1344 self.maybe_capture_fn_refs(node);
1345 let mut cursor = node.walk();
1346 let children: Vec<Node<'t>> = node.named_children(&mut cursor).collect();
1347 for c in children {
1348 self.scan_fn_ref_subtree(c, depth + 1);
1349 }
1350 }
1351
1352 fn flush_fn_ref_candidates(&mut self) {
1353 let cands = std::mem::take(&mut self.fn_ref_cands);

Callers 1

visitMethod · 0.45

Calls 3

walkMethod · 0.80
maybe_capture_fn_refsMethod · 0.45
collectMethod · 0.45

Tested by

no test coverage detected