pub mod rust;
use crate::error::Result;
use crate::ingest::rust::RustSymbolKind;
use std::path::Path;
#[derive(Debug, Clone, PartialEq)]
pub struct Reference {
pub file_path: String,
pub byte_start: usize,
pub byte_end: usize,
pub line: usize,
pub column: usize,
pub context: ReferenceContext,
pub match_id: Option<String>,
}
#[derive(Debug, Clone, PartialEq)]
pub enum ReferenceContext {
FunctionCall {
is_qualified: bool,
},
TypeReference,
Identifier,
ImportStatement,
FieldAccess,
GenericParameter,
}
#[derive(Debug, Clone)]
pub struct ReferenceSet {
pub references: Vec<Reference>,
pub definition: SymbolDefinition,
pub has_glob_ambiguity: bool,
}
#[derive(Debug, Clone)]
pub struct SymbolDefinition {
pub name: String,
pub kind: RustSymbolKind,
pub file_path: String,
pub byte_start: usize,
pub byte_end: usize,
pub is_public: bool,
}
pub fn find_references(
graph: &crate::graph::CodeGraph,
file_path: &Path,
symbol_name: &str,
symbol_kind: Option<RustSymbolKind>,
) -> Result<ReferenceSet> {
rust::find_rust_references(graph, file_path, symbol_name, symbol_kind)
}