Open Anton-4 opened 1 year ago
I dunno if this is related, but something that would be really handy for documentation generation is a way to take code snippets in doc comments and do token-based highlighting - so, don't translate it into an actual Roc parse::ast
node (because that discards spaces, and also fails if it sees something it doesn't recognize) but rather doing a relaxed token-based highlighting that preserves spaces, never fails, and yet would let us emit colored <span>
s in the docs generation.
:+1: I think the TSG fits all these constraints :)
The editor will be projectional by default and will not need a tree sitter grammar(TSG) to highlight in that mode because it uses the Abstract Syntax Tree. However because projectional editors can make some editing operations very difficult we want to allow the user to switch to legacy mode where they are completely free to delete or add text just like in regular editors like VScode.
For this legacy mode we would also like to have syntax highlighting, which would be enabled by the TSG.
To construct this grammar the following file will be useful: