The rust-analyzer syntax coloring looks great with the default (Dark) color theme in VS Code.
However, changing the VS Code color theme to pretty much anything else (via "Preferences: Color Theme") kind of breaks syntax coloring. In particular, all the "light" color themes are basically incompatible with rust-analyzer.
It seems like rust-analyzer is hard-coding some color values? Perhaps this behavior should be disabled by default, and optionally enabled by users in their settings.json?
You can disable it in the settings
Indeed! Here is the relevant rust-analyzer setting:
https://github.com/rust-analyzer/rust-analyzer/blob/master/editors/code/package.json#L148
In particular, adding this line to my settings.json does the trick:
"rust-analyzer.highlightingOn": false,
It seems to me like false should be default behavior. If not, maybe users should get a warning if they're not using the ZenBurn color theme?
I just realized this behavior is documented:
https://github.com/rust-analyzer/rust-analyzer/blob/master/editors/README.md#syntax-highlighting
The ra highlighting makes the One Dark theme look very unpleasant as well. Setting the default to false would be much less jarring when first installing the plugin.
Default should now be false
Most helpful comment
Indeed! Here is the relevant rust-analyzer setting:
https://github.com/rust-analyzer/rust-analyzer/blob/master/editors/code/package.json#L148
In particular, adding this line to my
settings.jsondoes the trick:It seems to me like
falseshould be default behavior. If not, maybe users should get a warning if they're not using the ZenBurn color theme?I just realized this behavior is documented:
https://github.com/rust-analyzer/rust-analyzer/blob/master/editors/README.md#syntax-highlighting