-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Following up on #4400. Right now, Rust attributes are left as the default color. Both the TextMate grammar and the semantic coloring rules specify meta.attribute.rust, which has no effect. In the default Dark+ theme, they show up as plain white:
To me, this seems like more of an oversight than an intentional choice. Now that semantic coloring is available, rust-analyzer is "taking ownership" of syntax coloring, so it makes sense to fix this here. What do other languages do?
C# attributes are colored with normal syntax coloring, with the surrounding brackets punctuation.squarebracket.open.cs, which is the default color in Dark+:
Typescript decorators are colored with normal syntax coloring, with the @ symbol punctuation.decorator.ts, which is the default color in Dark+:
Java annotations are colored with normal syntax coloring, with the @ symbol punctuation.definition.annotation.java, which is the default color in Dark+:
Based on these precedents, I propose that we color the inner parts of Rust attributes with the normal syntax coloring rules, and the surrounding #[] as punctuation.attribute.rust, which will render as the default color in the builtin themes (as it does now).
LMK what you think @matklad
@aloucks FYI



