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

Method scan_fn_ref_subtree

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

Source from the content-addressed store, hash-verified

1412 }
1413
1414 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
1415 if depth > 12 {
1416 return;
1417 }
1418 // functionTypes is EMPTY for C#; the literal halt list applies —
1419 // lambda_expression IS C#'s lambda, so initializer lambdas stop the
1420 // scan; anonymous_method_expression is NOT listed and scans through.
1421 if depth > 0
1422 && matches!(
1423 node.kind(),
1424 "arrow_function" | "function_expression" | "lambda_literal" | "lambda_expression"
1425 )
1426 {
1427 return;
1428 }
1429 self.maybe_capture_fn_refs(node);
1430 for i in 0..node.named_child_count() {
1431 if let Some(c) = node.named_child(i) {
1432 self.scan_fn_ref_subtree(c, depth + 1);
1433 }
1434 }
1435 }
1436
1437 fn flush_fn_ref_candidates(&mut self) {
1438 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