use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SymbolRef {
pub name: String,
pub file: String,
pub line: u32,
pub end_line: u32,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Neighborhood {
pub definition: SymbolRef,
pub callers: Vec<SymbolRef>,
pub callees: Vec<SymbolRef>,
pub imports: Vec<SymbolRef>,
pub stale: bool,
}
pub trait CodeGraph: Send + Sync {
fn neighborhood(&self, symbol: &str) -> Option<Neighborhood>;
fn neighborhood_all(&self, symbol: &str) -> Vec<Neighborhood> {
self.neighborhood(symbol).into_iter().collect()
}
fn resolve_in_file(&self, file: &str, name: &str) -> Option<SymbolRef>;
fn symbol_names(&self) -> Vec<String>;
}