Added minimal syntax highlighting
Added simple tokenizer to implement basic syntax highlighting respecting the simplicity of the project
Features:
- Improves UX or DX
- It's generic which means works on any language
- Simple & performant
Note: Currently it only highlights basic things like numbers, identifier, strings, comments // or # and symbols.
This is an experimental feature provide --enable-exp-highlighting flag to enable
It was a fascinating experience working on this project
Your implementation is a classic tokenizer. Unfortunately, we can't merge it because we would need flexible support for more languages. I'm super happy you liked experimenting on the project though!
(FYI I'm also working on this right now: https://github.com/microsoft/edit/pull/624#issuecomment-3566988552)
@lhecker I was going to do the same, but wouldn’t that make it more complex and slow down the app? 🤔 Here’s a new solution: we could add language-specific highlighting only for languages like HTML, XML/XAML, YML/YAML, CSS/SCSS, and TOML. For other languages, we could have the tokenizer handle basic elements like booleans or simple keywords using LSPs. 🤷