diff --git a/refactron/rag/indexer.py b/refactron/rag/indexer.py index 690cfe3..b375b1a 100644 --- a/refactron/rag/indexer.py +++ b/refactron/rag/indexer.py @@ -89,6 +89,8 @@ def __init__( ) self.parser = CodeParser() + from refactron.rag.chunker import CodeChunker + self.chunker = CodeChunker(self.parser) def index_repository( self, repo_path: Optional[Path] = None, summarize: bool = False @@ -171,11 +173,8 @@ def _index_file(self, file_path: Path, summarize: bool = False) -> List[CodeChun Returns: List of code chunks that were indexed """ - from refactron.rag.chunker import CodeChunker - # Chunk the file (parser is called inside chunker) - chunker = CodeChunker(self.parser) - chunks = chunker.chunk_file(file_path) + chunks = self.chunker.chunk_file(file_path) if summarize and self.llm_client: for chunk in chunks: