Breaking changes for improved startup time and error handling!
Thanks to @Enselic for basically all the work to make this release happen!
Breaking changes
- Lazy-load syntaxes to significantly improve startup time. This changes the binary format of syntax dump files.
- Remove
ContextId::new()
from public API to support lazy-loading of syntaxes - Rename
HighlightLines::highlight()
toHighlightLines::highlight_line()
to make it clear that the function takes one line at a time - Make
plist
dependency (used for loading themes) optional via newplist-load
feature - Remove obsolete
dump-load-rs
anddump-create-rs
features that has been identical todump-load
anddump-create
for two years - Remove deprecated items
ThemeSettings::highlight_foreground
,ThemeSettings::selection_background
,ClassedHTMLGenerator::new
,ClassedHTMLGenerator::parse_html_for_line
,html::css_for_theme
,html::tokens_to_classed_html
andhtml::tokens_to_classed_spans
- Mark all error enums as
#[non_exhaustive]
- These functions have been changed to return a
Result
to allow propagation of errors:html::ClassedHTMLGenerator::parse_html_for_line_which_includes_newline
html::append_highlighted_html_for_styled_line
html::css_for_theme_with_class_style
html::highlighted_html_for_string
html::line_tokens_to_classed_spans
html::styled_line_to_highlighted_html
parsing::ParseState::parse_line
parsing::ScopeStack::apply
parsing::ScopeStack::apply_with_hook
parsing::syntax_definition::Context::match_at
parsing::syntax_definition::ContextReference::id
parsing::syntax_definition::ContextReference::resolve
Other changes
- Fall back to
Plain Text
if a referenced syntax is missing - Add support for
hidden_file_extensions
key in syntaxes. - Implement
Error
andDisplay
for all error enums by usingthiserror
- Replace
lazycell
withonce_cell
to fix crash on lazy initialization - Add
ScopeRangeIterator
- Add CI check for Minimum Supported Rust Version. This is currently Rust 1.53.
- Make looking up a syntax by extension use case-insensitive comparison
- Make
from_dump_file()
~15% faster - Blend alpha value on converting colors to ANSI color sequences
- Fix sample code in documentation to avoid double newlines
- Fix lots of build warnings and lints
- Add Criterion benchmarks for a whole syntect pipeline and for
from_dump_file()