MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / extract_references

Method extract_references

atomic-semantic/src/parsers/rust.rs:608–616  ·  view source on GitHub ↗

Extract all function call sites from a Rust source file. Each `Reference` has: - `symbol` — the simple callee name (e.g., `"authenticate"`, not `"auth::authenticate"`) - `file` — the caller file path - `line` — 1-based line of the call expression - `confidence` — always `High` (tree-sitter parse is exact)

(&mut self, source: &str, file_path: &str)

Source from the content-addressed store, hash-verified

606 /// - `line` — 1-based line of the call expression
607 /// - `confidence` — always `High` (tree-sitter parse is exact)
608 fn extract_references(&mut self, source: &str, file_path: &str) -> Vec<Reference> {
609 let tree = match self.parser.parse(source, None) {
610 Some(t) => t,
611 None => return vec![],
612 };
613 let mut refs = Vec::new();
614 self.walk_tree_for_calls(&tree.root_node(), source, file_path, &mut refs);
615 refs
616 }
617}
618
619// ═══════════════════════════════════════════════════════════════════════

Callers

nothing calls this directly

Calls 2

parseMethod · 0.45
walk_tree_for_callsMethod · 0.45

Tested by

no test coverage detected