trishume / syntect

Rust library for syntax highlighting using Sublime Text syntax definitions.
https://docs.rs/syntect
MIT License
1.89k stars 132 forks source link

No convenient way to combine loading defaults + files #497

Closed jplatte closed 10 months ago

jplatte commented 10 months ago

It would be nice if there was something like SyntaxSetBuilder::add_defaults_newlines / SyntaxSetBuilder::add_defaults_nonewlines, since right now to make a SyntaxSet with defaults plus extra ones, you have to clone every SyntaxDefinition from one of the default syntax sets to pass them to SyntaxSetBuilder::add AFAICT.

jplatte commented 10 months ago

Ah, actually I just found SyntaxSet::into_builder after writing this. Sorry for the noise!