Expand description
Incremental parsing support for tree-sitter.
This module provides utilities for incremental AST parsing using tree-sitter’s
InputEdit API. When a file changes, instead of re-parsing from scratch,
tree-sitter can reuse unchanged portions of the old parse tree.
§Architecture
InputEditCalculator: Calculates byte/line/column edits between file versionsTreeCache: LRU cache storing recently parsed trees for reuseIncrementalParser: High-level wrapper coordinating incremental parsing
§Performance
Incremental parsing typically provides 5-10x speedup for small edits compared to full re-parsing, as tree-sitter reuses unchanged AST subtrees.
Structs§
- Incremental
Parser - High-level incremental parser coordinating tree caching and re-parsing.
- Input
Edit Calculator - Calculates
InputEditdescribing changes between two file versions. - Tree
Cache - LRU cache for parsed trees to enable incremental parsing.