Skip to main content

Module chunks_ts

Module chunks_ts 

Source
Expand description

Tree-sitter AST-aware code chunking for semantic search.

Replaces heuristic line-prefix matching with proper AST parsing. Extracts function bodies, struct definitions, class declarations etc. as complete, self-contained chunks with accurate boundaries.

Falls back to heuristic chunking for unsupported languages.

Functionsยง

extract_chunks_ts
Extract code chunks from a file using tree-sitter AST parsing.