rust-lang / rust-lang/rust-analyzer
Missing constant color highlighting inside `stringify!`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
rust-analyzer version: 0.3.1435-standalone (f1e51afa4 2023-03-12)
rustc version: 1.70.0-nightly (ff4b772f8 2023-03-10)
relevant settings: Shouldn't be relevant to the bug per se, but I'm using this color theme.
While experimenting with macro_rules, I found the following weird behavior:

For some reason, when using an all-caps snake-case argument with the stringify!() macro that begins with a single all-cap letter followed by an underscore (I know, this is such a niche case that I won't be hurt if this gets backlogged forever), the corresponding argument isn't properly highlighted. I suspect this is an issue with semantic tokens (?) since the inspector shows the following:


Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported macro_rules case involving an all-caps snake-case argument beginning with a single capital letter followed by an underscore. Inspect the semantic-token output using the editor's inspector, then investigate stringify! handling. Done means the corresponding argument receives the expected color highlighting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100