Conversation
|
looking forward to the other languages. they seemed to work well enough in https://github.com/microsoft/edit/tree/4f36e2afe2a84ed339829ea6c63242fb9f4b7de3 (well, really long Here Strings made the rest of the file red, but ones with a reasonable length were fine) |
|
PR awaiting 2 pending checks still. |
|
Working on this feature? In the current economy?! |
|
Thanks for your work on this. I've played around with this branch a bit and want to share my thoughts on the current implementation. I tried to hack together basic C highlighting and noticed there is some state missing for "constants" (convention with all-uppercase variables usually defined with Could the regexes be loaded from a file in the future? It might save some work to implement the basic functionality now by parsing a hardcoded string rather than defining everything in Another thing I wondered about is why the Edit: |
|
FYI I've continued development in the https://github.com/microsoft/edit/tree/dev/lhecker/syntax-highlighting-alt branch where I've since written a custom language with proper compiler. It even has rudimentary support for variables. It's fairly time consuming to develop so it's taking a while. It's also certainly not done yet, but please feel free to check it out already. You can find the definition files under |
|
Why not tree-sitter integration for syntax highlighting and text objects ? You basically get for "free" countless languages. (implementation not considered) |
FWIW, this has been hashed out over in #18. In fact, the justification for having a simple syntax highlighter that is expressly not tree-sitter is described in the issue body of #18. TL;DR (and it really is not much longer than this comment here): tree-sitter is huge. Edit is 250KiB. We don't want edit to become much larger than it already is. |
33890d3 to
3f386a9
Compare
|
Well, so this ain't a "draft for syntax highlighting" anymore by any measure. This PR is now 7000 lines and contains an entire frigging compiler lol. (...which btw is extremely poorly engineered. 😭😭) To anyone who reads this: Have fun testing this! Definitions are in |


This adds syntax highlighting for git commit and rebase messages.
Support for other languages is on hold until I finished writing a
proper VM for executing the highlighting instructions.
Closes #18