Skip to main content

Module oneshot

Module oneshot 

Source
Expand description

D.3.b.2 (2026-05-29): one-shot synchronous highlight.

Wraps Syntax::for_language_with_registry + parse + snapshot().highlight_lines into a single call so callers that don’t own a long-lived SyntaxHandle (notably the diff overlay’s deletion-block renderer, which parses an ephemeral baseline rope) can get styled spans without standing up an actor or wiring incremental state.

No caching. Every call re-parses the source from scratch. The caller is expected to cache the returned spans alongside whatever revision it tracks for the source.

See docs/dev/architecture/diff-system.md §6.6.

Functions§

oneshot_highlight_lines
Run a fresh tree-sitter parse over source and return per-line styled spans for lines in start_line..end_line.