Make bat::PrettyPrinter::syntaxes()
iterate over new bat::Syntax
struct
#2222
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.
We can't keep
syntect::parsing::SyntaxReference
as part of the public API, because that might prevent us from bumping to syntect 6.0.0 without also bumping bat to v2.0.0.So introduce a new stripped down struct
Syntax
and return that instead. Let it be fully owned to make the API simple. It is not going to be in a hot code path anyway.I have looked at all code of our 27 dependents but I can't find a single instance of this method being used, so this change should be safe for v1.0.0. It is only used in our own example code as far as I can tell.
For reference (mostly to my future self), here is the script I used to download the code of all dependents. Then one can grep around in the code of dependents:
Also see #2221