Update to syntect 4.1, fancy-regex support #900
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the
syntect
dependency to 4.1.It also adds a
regex-onig
feature (enabled for the application) and aregex-fancy
feature, which can be enabled to usefancy-regex
as an engine insyntect
.With this change, applications which depend on
bat
as a library, can useto remove the
onig
dependency. The full dependency tree after this update is attached below.One problem that has not yet been resolved is the included set of syntaxes, which is not fully compatible with
regex-fancy
(due to regex rewriting, as described in the syntect 4.0 release notes) because it has been built with a version ofbat
that usesregex-onig
. Fixing this would probably require us tobat
(bat-onig
andbat-fancy
)assets/create.sh
to runbat cache --build …
with both versions, creating two different binary dumpsassets.rs
to read the respective binary, depending on the chosen feature:bat/src/assets.rs
Lines 96 to 98 in 3355aeb
Unfortunately, that is currently not possible (with the full syntax set), due to trishume/syntect#287
FYI: @dtolnay
Full dependency tree when using
features = ["regex-fancy"]