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§
- Rust
Macro Body - The template of one
macro_rules!arm, located in the original source. - Rust
Macro Facts - What call extraction learned about Rust macros beyond the calls themselves.
- Rust
Macro Fragment Cache - 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 withnav.- 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, orNonewhen 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 withnav.- extract_
rust_ calls_ with_ macro_ facts - Rust call extraction including calls written inside macro token trees:
invocation arguments (
vec![f(x)],tokio::select! { .. }) andmacro_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 withnav. 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 withnav.- 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§
- Call
Tuple - Call-site tuple shared by the extraction helpers:
(full_callee, short_name, line, byte_start, byte_end).