rascal
rascal copied to clipboard
Introduce a fixed set of syntax highlighting categories to replace the old string based categories in parse trees
Right now people writing a grammar can add @Category annotations on their productions to get syntax highlighting in their IDE. It's been a bit of a mixed bag of what to write vs what you'll get. usethesource/rascal-language-servers#366 was a recent case of this misalignment.
After some more discussions with @jurgenvinju we came to the following design:
ParseTreegets a new ADT calledHighlight- We use a fixed set of highlight categories (that happen to mirror the LSP SemanticTokenType categories)
- Production rules can now be annotated with either the deprecated
@Categoryor the new@Highlight=number()