Skip to content

v1.6.0

Choose a tag to compare

@Goldziher Goldziher released this 14 Apr 08:44
· 798 commits to main since this release
e0ccfad

What's New

Performance: Parser & Query Caching

  • Thread-local parser cacheparse_string() now reuses parsers across calls for the same language, avoiding the cost of creating a new parser every time
  • Two-level compiled query cacherun_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 & intelligenceCompiledExtraction::extract() and intel::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 propagates Error::LockPoisoned instead of silently ignoring poisoned RwLock
  • QueryCursor byte-range no longer leaks between patterns when reusing the cursor in extract_from_tree()
  • Replaced std::collections::HashMap with ahash::AHashMap in parser cache for consistency
  • Redundant get_language() call removed from parse_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.rs now prefers sources/language_definitions.json over the crate-local copy to prevent future staleness

Go Symbol Extraction

  • Go type_spec declarations (structs, interfaces, type aliases) are now extracted as symbols with correct SymbolKind

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