Skip to content

Conversation

@A4-Tacks
Copy link
Member

@A4-Tacks A4-Tacks commented Jan 9, 2026

The editor has already highlighted the keywords, and users may not necessarily need r-a highlighted keywords

The editor has already highlighted the keywords, and users may not necessarily need r-a highlighted keywords
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 9, 2026
@ChayimFriedman2
Copy link
Contributor

I... don't know how I feel about yet another config.

Sure, the editor will usually highlight them, but is it this bad to highlight them us too? Also FWIW the editor handling is incorrect at least in some editors, e.g. VSCode does not highlight contextual keywords like union or raw.

@A4-Tacks
Copy link
Member Author

A4-Tacks commented Jan 9, 2026

but is it this bad to highlight them us too?

The keyword highlighting of r-a is difficult to customize, so I usually disable the highlighting of r-a.
But disable r-a highlighting means that symbols and formatting cannot be highlighted either

BTW, I also plan to add configuration in other PR to disable symbol highlighting

Also FWIW the editor handling is incorrect at least in some editors

This config is enabled by default, it's not a big problem

@ChayimFriedman2
Copy link
Contributor

The keyword highlighting of r-a is difficult to customize

How so? It provides even more granularity than the usual editor, and of course the colors are completely your choice.

This config is enabled by default, it's not a big problem

It is a big problem for maintainability and searchability of the configs. Not this specific one, of course, but the dozens of configs we're accumulating (we already have almost 200 options!) In the past the approach was to say "yes" to any user wanting a config (and finding someone to implement it, of course). Now I believe the default should be "no" unless the config will matter for many users, or will be very important to few. Of course that's only my personal opinion.

CC @rust-lang/rust-analyzer what are your thoughts on this, and on the subject in general?

@A4-Tacks
Copy link
Member Author

A4-Tacks commented Jan 9, 2026

It provides even more granularity than the usual editor

But disabling r-a highlighting, editor configuration can refine colors to specific keywords instead of all keywords or category

@ChayimFriedman2
Copy link
Contributor

r-a does provide some tags to keywords groups. If you want more granular control than that then I'll repeat my saying that I don't believe r-a should support that.

@Veykril
Copy link
Member

Veykril commented Jan 9, 2026

This is technically solved by the lsp augmentsSyntax or whatever that s called capability I think which will make r-a drop most regular highlighting that are unnecessary, unfortunately the text mate grammar VSCode ships for rust is really bad so we've disabled that capability in the extension code.

@davidbarsky
Copy link
Contributor

I think @Wilfred got commit bit on the underlying Textmate grammar recently and might be able to get improvements into it. I'm pretty sure that VS Code will pick any changes on their next submodule sync.

@Wilfred
Copy link
Contributor

Wilfred commented Jan 9, 2026

Yep, happy to review any PRs on https://github.com/dustypomerleau/rust-syntax. I haven't noticed it being terribly bad, would be interested to hear what issues you've seen.

@Veykril
Copy link
Member

Veykril commented Jan 9, 2026

I don't recall specifics, just that it vastly differs from what our semantic tokens map to meaning unanalyzed things look completely different than analyzed ones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants