Convert semantic token types to TextMate scopes #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Consider:
Digit
would just get scope namenumber
. However, whilenumber
is a semantic token type, it is not one of the standard TextMate scope names in VS Code (VS Code reports "No theme selector" and doesn't highlight). For semantic highlighting, VS Code does the conversion from incoming semantic token types to TextMate scope names itself, but scope names in TextMate grammars are uninterpreted. Thus, we need to make sure that the Rascal-Textmate converter already converts semantic token types (that occur in a Rascal grammar) to standard TextMate scopes before inserting them in a TextMate grammar.constant.numeric
Additionally, this PR also moves the conversion of legacy semantic token types into the general converter (used to be done only for Rascal's own grammar, but it should always be done). Tests were updated too.