Rust library for syntax highlighting using Sublime Text syntax definitions.
MIT License
Bot releases are hidden (Show)
Published by Enselic about 1 year ago
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 verbosePublished by trishume over 2 years ago
Thanks 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()
Published by trishume almost 3 years ago
See the release notes for v4.7.0, this release removes a new Cargo feature which constituted a semver violation:
Published by trishume almost 3 years ago
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
Published by trishume about 3 years ago
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.5Published by trishume almost 4 years ago
Published by trishume about 4 years ago
Published by trishume over 4 years ago
onig
and plist
. The new onig
version doesn't require bindgen
thus making compilation easier. #293
Published by trishume over 4 years ago
Published by trishume over 4 years ago
Published by trishume over 4 years ago
fancy-regex
engine optionUsers can now opt in to a pure-Rust regex engine using Cargo features, making
compilation easier in general. People experiencing difficulty compiling for
Windows and Wasm should try switching to fancy-regex
. Note this currently
approximately halves highlighting speed.
See the Readme and #270 for details.
Thanks to @robinst for implementing this!
Upgrading should cause no errors for nearly all users. Users using more unusual APIs may have a small amount of tweaking to do.
default-features = false
you may need to update your features to choose a regex enginePublished by trishume about 5 years ago
as_latex_escaped
utilPublished by trishume about 5 years ago
Hopefully no behavior changes.
Published by trishume over 5 years ago
Really a bug fix but the bug was not having an API be public so hence SemVer demands a minor version bump.
Published by trishume over 5 years ago
Published by trishume almost 6 years ago
with_prototype
s (#220, fixes #160, #178, ASP highlighting)Published by trishume about 6 years ago
See previous release for major breaking changes and new things.
Published by trishume about 6 years ago
This is a major release with multiple breaking API changes, although upgrading shouldn't be too difficult. It fixes bugs and comes with some nice new features.
SyntaxSet
API has been revamped to use a builder and an arena of contexts. See example usage.SyntaxSet
that goes with the rest of their arguments because of this new arena.LoadingError::ParseSyntax
html
module now take the newlines
version of syntaxes.
SyntaxSet::add_syntax -> SyntaxSetBuilder::add
SyntaxSet::load_syntaxes -> SyntaxSetBuilder::add_from_folder
SyntaxSet::load_plain_text_syntax -> SyntaxSetBuilder::add_plain_text_syntax
html::highlighted_snippet_for_string -> html::highlighted_html_for_string
: also change to newlines
SyntaxSet
html::highlighted_snippet_for_file -> html::highlighted_html_for_file
: also change to newlines
SyntaxSet
html::styles_to_coloured_html -> html::styled_line_to_highlighted_html
: also change to newlines
SyntaxSet
html::start_coloured_html_snippet -> html::start_highlighted_html_snippet
: return type also changedSyntaxSetBuilder
API for constructing new SyntaxSet
snonewlines
mode is often buggy so we made it easier to use the newlines
mode.
LinesWithEndings
utility for iterating over the lines of a string with \n
characters.html
module to use newlines
syntaxes.split_at
and modify_range
in the util
module.ThemeSet::add_from_folder
function (#200): For modifying existing theme sets.set
: #177 #166embed
to not include prototypes: #172 #1600.2 -> 0.3
0.2 -> 1.0
3.2.1 -> 4.1
Published by trishume over 6 years ago
CMakeLists.txt
Published by trishume over 6 years ago
Thanks to @robinst for the headline features of this release!