Rust library for syntax highlighting using Sublime Text syntax definitions.
syntect::util::split_at()
handles multi-byte charactersPartialEq
for Theme
fancy-regex
to 0.11regex-syntax
to 0.7lazy_static
with once_cell
Debug
impl of syntect::highlighting::Color
less verboseThanks to @Enselic for basically all the work to make this release happen!
Breaking changes
ContextId::new()
from public API to support lazy-loading of syntaxesHighlightLines::highlight()
to HighlightLines::highlight_line()
to make it clear that the function takes one line at a timeplist
dependency (used for loading themes) optional via new plist-load
featuredump-load-rs
and dump-create-rs
features that has been identical to dump-load
and dump-create
for two yearsThemeSettings::highlight_foreground
, ThemeSettings::selection_background
, ClassedHTMLGenerator::new
, ClassedHTMLGenerator::parse_html_for_line
, html::css_for_theme
, html::tokens_to_classed_html
and html::tokens_to_classed_spans
#[non_exhaustive]
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
Plain Text
if a referenced syntax is missinghidden_file_extensions
key in syntaxes.Error
and Display
for all error enums by using thiserror
lazycell
with once_cell
to fix crash on lazy initializationScopeRangeIterator
from_dump_file()
~15% fasterfrom_dump_file()
See the release notes for v4.7.0, this release removes a new Cargo feature which constituted a semver violation:
Big release this time thanks to tons of fantastic contributions from @Enselic, this release was basically all him! The headline feature is much faster startup time due to lazy-loading at the syntax level.
ContextId::new()
from public API to support lazy-loading of syntaxes. This is technically a breaking change but I have no idea why I made this API public and I'm pretty sure zero people have used it.ScopeRangeIterator
html::line_tokens_to_classed_spans
to also take a mutable ScopeStack, deprecate tokens_to_classed_spans
, to avoid panics and incorrect highlighting.find_unlinked_contexts
to SyntaxSet
syntaxes
method to SyntaxSetBuilder
fancy-regex
to v0.7 and yaml-rust
to v0.4.5onig
and plist
. The new onig
version doesn't require bindgen
thus making compilation easier. #293