-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add semantic token modifiers for punctuation #6152
Comments
I believe that textmate scopes for these would be a better fit, since punctuations don't really have any semantic meaning in this case and you can use textmate scopes just fine with semantic highlighting enabled, as it falls back in those cases where it isn't used for tokens. |
TextMate might work too, but our TextMate doesn't produce dedicated scopes for different punctuation symbols: cc #6137 |
Yes those would have to be split up into multiple categories, would go well with that open PR right now I guess 😄 |
Some semantic highlighting approaches ignore punctuation, which allows the underlying TextMate scopes to shine through. But this is not the case with RA, so with semantic highlighting enabled, the color of all bracket types will be whatever color the theme sets for |
Oh interesting, now that you say it there is a |
Agree we should do this. Perfect rust-analyzer client wouldn't have text mate scopes at all, and would rely solely on semantic tokens. |
I used to have different colors for curly braces, operators, parens, brackets and other punctuation in TypeScript.
Take this colorization as an example:
It is not possible to achieve this amount of color diversity for punctuation in rust-analyzer for now, so I propose to add more specific semantic token modifiers for punctuation:
punctuation.curlyBrace
,punctuation.bracket
,punctuation.paren
... so that it is possible to control the style of each individual punctuation symbol kind.I am not insisting on implementing this via semantic token modifiers, this is just the first thing that comes to my head.
The text was updated successfully, but these errors were encountered: