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

Method scan_fn_ref_subtree

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

Source from the content-addressed store, hash-verified

2014 }
2015
2016 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
2017 stack_guard!();
2018 if depth > 12 {
2019 return;
2020 }
2021 // Halt list: functionTypes (function_signature) + the lambda kinds —
2022 // function_expression IS dart's lambda, so constant-initializer
2023 // lambdas don't leak candidates.
2024 if depth > 0
2025 && matches!(
2026 node.kind(),
2027 "function_signature" | "arrow_function" | "function_expression"
2028 | "lambda_literal" | "lambda_expression"
2029 )
2030 {
2031 return;
2032 }
2033 self.maybe_capture_fn_refs(node);
2034 let mut cursor = node.walk();
2035 let children: Vec<Node<'t>> = node.named_children(&mut cursor).collect();
2036 for c in children {
2037 self.scan_fn_ref_subtree(c, depth + 1);
2038 }
2039 }
2040
2041 fn flush_fn_ref_candidates(&mut self) {
2042 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