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–568  ·  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 if depth > 12 {
554 return;
555 }
556 let kind = node.kind();
557 if depth > 0
558 && (is_function_type(kind) || matches!(kind, "lambda_literal" | "lambda_expression"))
559 {
560 return;
561 }
562 self.maybe_capture_fn_refs(node);
563 for i in 0..node.named_child_count() {
564 if let Some(c) = node.named_child(i) {
565 self.scan_fn_ref_subtree(c, depth + 1);
566 }
567 }
568 }
569
570 fn flush_fn_ref_candidates(&mut self) {
571 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