use loregrep::{LoreGrep, Result as LoreGrepResult};
#[tokio::main]
async fn main() -> LoreGrepResult<()> {
println!("🔍 Basic Repository Scanning Example");
println!("====================================\n");
let mut loregrep = LoreGrep::builder()
.with_rust_analyzer() .max_files(500) .build()?;
println!("📁 Scanning current directory...");
let scan_result = loregrep.scan(".").await?;
println!("✅ Scan completed successfully!\n");
println!("📊 Scan Statistics:");
println!(" • Files scanned: {}", scan_result.files_scanned);
println!(" • Functions found: {}", scan_result.functions_found);
println!(" • Structs found: {}", scan_result.structs_found);
println!(" • Scan duration: {}ms", scan_result.duration_ms);
if !scan_result.languages.is_empty() {
println!(" • Languages detected: {:?}", scan_result.languages);
}
if loregrep.is_scanned() {
println!("\n🎉 Repository is now indexed and ready for analysis!");
let stats = loregrep.get_stats()?;
println!("📋 Current index contains:");
println!(" • {} files", stats.files_scanned);
println!(" • {} functions", stats.functions_found);
println!(" • {} structs", stats.structs_found);
} else {
println!("\n⚠️ Repository scanning completed but no files were indexed.");
println!(" This might happen if no supported files were found.");
}
println!("\n💡 Next steps:");
println!(" • Use the search tools to find specific functions or structs");
println!(" • Analyze individual files for detailed information");
println!(" • Integrate with your coding assistant or development workflow");
Ok(())
}