v1.6.0
What's New
Performance: Parser & Query Caching
- Thread-local parser cache —
parse_string()now reuses parsers across calls for the same language, avoiding the cost of creating a new parser every time - Two-level compiled query cache —
run_query()caches compiled tree-sitter queries in both a thread-local cache (fast, no locking) and a global shared cache (cross-thread reuse) - Cached parsers in extraction & intelligence —
CompiledExtraction::extract()andintel::parse_source()now use the thread-local parser cache - Pre-computed capture names in
CompiledExtraction— avoids rebuilding capture name vectors on every extraction call - QueryCursor reuse across patterns within a single
extract_from_tree()call
Bug Fixes
compiled_query()now propagatesError::LockPoisonedinstead of silently ignoring poisoned RwLockQueryCursorbyte-range no longer leaks between patterns when reusing the cursor inextract_from_tree()- Replaced
std::collections::HashMapwithahash::AHashMapin parser cache for consistency - Redundant
get_language()call removed fromparse_string()hot path — only called on cache miss - Fixed stale crate-local
language_definitions.json(frozen at 248 languages) causing missing extension mappings for 58 newer languages - Resolved 4 duplicate extension conflicts:
.gd(gap/gdscript),.conf(hocon/nginx),.sv/.svh(verilog/systemverilog) build.rsnow preferssources/language_definitions.jsonover the crate-local copy to prevent future staleness
Go Symbol Extraction
- Go
type_specdeclarations (structs, interfaces, type aliases) are now extracted as symbols with correctSymbolKind
Documentation
- New dedicated "Download Parsers" section in the quickstart guide covering:
- CLI, Python, Node.js, and Rust download APIs
- Language groups (
web,systems,scripting,data,jvm,functional) - Docker and CI pre-download examples
- Configuration file (
language-pack.toml) setup - Cache location and override options
Full Changelog: v1.5.0...v1.6.0