Stream: t-compiler/rust-analyzer

Topic: Syntax Highlighting partially broken?


Lukas Wirth (May 09 2020 at 21:48, on Zulip):

I just started vscode to be greeted by struct names suddenly having the same color as keywords, at least when using the One Dark Pro theme as well as fields having the same color as functions now. Is this already a known problem that recently popped up? Code_uDWfPvtyqL.png

Lukas Wirth (May 09 2020 at 21:55, on Zulip):

In other themes, structs and keywords dont have the same color, but structs and type aliases do not share the same color either + not using RA gives a different color spread(with the default rust syntax highlighting) than when using it.

Lukas Wirth (May 09 2020 at 22:14, on Zulip):

Okay updating to RA nightly seems to have fixed the problem mostly, tho fields are still colored like functions which i believe was not always the case?

George Fraser (May 10 2020 at 00:20, on Zulip):

Textmate scopes can be really weird and surprising. The fact that struct names were colored like keywords was a VSCode bug, which they just fixed, that's why nightly is better for that one: https://github.com/microsoft/vscode/issues/97162

There are a bunch of other small issues with the textmate scopes used by semantic coloring, including the one you mentioned about fields getting colored like functions. I've proposed a PR in rust-analyzer to fix those: https://github.com/rust-analyzer/rust-analyzer/pull/4397

Lukas Wirth (May 10 2020 at 08:54, on Zulip):

Ah I see, I already suspected Semantic coloring, thanks for clarifying

Last update: Jul 28 2021 at 05:00UTC