zed/crates/language
Kirill Bulatov 9258c00626 language: Cache buffer syntax highlighting per row chunk
BufferSnapshot::chunks re-ran the tree-sitter highlight query over the
requested range on every call, so scrolling and cursor movement paid the full
query cost per frame.

Highlight captures are now computed once per 50-row chunk (the same RowChunks
that back bracket colorization), flattened into runs of capture-id stacks, and
kept in a cost-budgeted per-buffer LRU (10MB). Runs resolve through the
current HighlightMap at read time, so theme changes need no invalidation;
edits and reparses drop the cache through the existing TreeSitterData swap.
Chunks spanning more than 64KB bypass the cache and fall back to direct
querying, so files with giant lines behave as before.

New editor_render_highlighted and editor_render_highlighted_minimap benches
move the cursor through a generated 10K-line Rust file with real highlighting,
with and without the minimap; ZED_DISABLE_HIGHLIGHT_CACHE=1 routes rendering
through the pre-existing direct-query path for comparison.
2026-08-24 15:33:14 +03:00
..
benches Extract language_core and grammars crates from language (#52238) 2026-03-25 23:41:09 +00:00
src language: Cache buffer syntax highlighting per row chunk 2026-08-24 15:33:14 +03:00
build.rs
Cargo.toml Switch from cargo-machete to cargo-shear (#62643) 2026-08-20 10:08:48 +00:00
LICENSE-GPL