Skip to main content

Module calls

Module calls 

Source
Expand description

Shared call-site extraction helpers.

Extracted from commands/zoom.rs so both the zoom command and the call-graph engine can reuse the same AST-walking logic.

Structs§

RustMacroBody
The template of one macro_rules! arm, located in the original source.
RustMacroFacts
What call extraction learned about Rust macros beyond the calls themselves.
RustMacroFragmentCache
Keeps fragment trees only while one content record is extracted. Both the call graph and dead-code facts walk the same macros, sometimes again for nested functions; parsing depends on the fragment text, not its caller.

Functions§

cache_rust_macro_fragments
call_node_kinds
Returns the tree-sitter node kind strings that represent call expressions for the given language.
extract_callee_name
Extract the callee name from a call expression node.
extract_calls_full
Extract calls with full callee expressions (including namespace qualifiers).
extract_calls_full_with
extract_calls_full, walking with nav.
extract_calls_in_range
Extract call expression names within a byte range of the AST.
extract_computed_member_name
The name a computed member access obj["name"] spells with a string literal, or None when its index is any other expression.
extract_full_callee
Extract the full callee expression from a call expression node.
extract_go_value_references
Extract Go expression references, including callbacks and package variables. Resolution rejects identifiers that do not name indexed package symbols.
extract_js_callback_references
Extract bare or namespace-qualified callback arguments, not invocation edges.
extract_js_callback_references_with
extract_js_callback_references, walking and looking up with nav.
extract_rust_calls_with_macro_facts
Rust call extraction including calls written inside macro token trees: invocation arguments (vec![f(x)], tokio::select! { .. }) and macro_rules! templates, which tree-sitter keeps as opaque tokens. Each token tree is parsed again on its own as Rust; tree-sitter’s error recovery still yields the calls in most macro argument shapes. Returns the calls sorted by position, plus the macro facts gathered on the way.
extract_rust_calls_with_macro_facts_with
extract_rust_calls_with_macro_facts, walking the outer tree with nav. Macro token trees are parsed on their own, so their trees are walked directly.
extract_rust_value_references
Extract Rust function paths used as values rather than called directly.
extract_rust_value_references_with
extract_rust_value_references, walking and looking up with nav.
extract_type_references
Extract all type-reference names in a parsed file.
rust_name_is_shadowed_at
Whether a binding shadows this name at an expression. Parameters, match/loop patterns, let conditions and preceding lets in enclosing blocks count; sibling scopes and later lets do not.

Type Aliases§

CallTuple
Call-site tuple shared by the extraction helpers: (full_callee, short_name, line, byte_start, byte_end).