pub struct CodebaseIndexer { /* private fields */ }Expand description
Generate concise codebase summaries for context injection.
Implementations§
Source§impl CodebaseIndexer
impl CodebaseIndexer
Sourcepub fn generate_index(&self, max_tokens: usize) -> String
pub fn generate_index(&self, max_tokens: usize) -> String
Generate a complete index of the codebase, compressed to fit within max_tokens.
Sourcepub fn generate_overview(&self) -> String
pub fn generate_overview(&self) -> String
Generate the overview section: file count, README excerpt, and project type.
Sourcepub fn generate_structure(&self) -> String
pub fn generate_structure(&self) -> String
Generate the directory structure section using tree or a basic fallback.
Sourcepub fn generate_key_files(&self) -> String
pub fn generate_key_files(&self) -> String
Generate a listing of key files by category (Main, Config, Tests, Docs).
Sourcepub fn generate_dependencies(&self) -> Option<String>
pub fn generate_dependencies(&self) -> Option<String>
Parse dependency files (requirements.txt, package.json, Cargo.toml).
Returns None if no dependency files are found.
Sourcepub fn detect_project_type(&self) -> Option<&str>
pub fn detect_project_type(&self) -> Option<&str>
Detect the project type based on indicator files.
Sourcepub fn compress_content(&self, content: &str, max_tokens: usize) -> String
pub fn compress_content(&self, content: &str, max_tokens: usize) -> String
Compress content to fit within a token budget by trimming paragraphs.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CodebaseIndexer
impl RefUnwindSafe for CodebaseIndexer
impl Send for CodebaseIndexer
impl Sync for CodebaseIndexer
impl Unpin for CodebaseIndexer
impl UnsafeUnpin for CodebaseIndexer
impl UnwindSafe for CodebaseIndexer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more