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

Method scan_fn_ref_subtree

codegraph-kernel/src/tsjs/mod.rs:552–569  ·  view source on GitHub ↗

scanFnRefSubtree: capture-only walk of subtrees the main walkers skip.

(&mut self, node: Node<'t>, depth: u32)

Source from the content-addressed store, hash-verified

550
551 /// scanFnRefSubtree: capture-only walk of subtrees the main walkers skip.
552 fn scan_fn_ref_subtree(&mut self, node: Node<'t>, depth: u32) {
553 stack_guard!();
554 if depth > 12 {
555 return;
556 }
557 let kind = node.kind();
558 if depth > 0
559 && (is_function_type(kind) || matches!(kind, "lambda_literal" | "lambda_expression"))
560 {
561 return;
562 }
563 self.maybe_capture_fn_refs(node);
564 for i in 0..node.named_child_count() {
565 if let Some(c) = node.named_child(i) {
566 self.scan_fn_ref_subtree(c, depth + 1);
567 }
568 }
569 }
570
571 fn flush_fn_ref_candidates(&mut self) {
572 let cands = std::mem::take(&mut self.fn_ref_cands);

Callers 1

visit_nodeMethod · 0.45

Calls 2

is_function_typeFunction · 0.85
maybe_capture_fn_refsMethod · 0.45

Tested by

no test coverage detected