rust-lang / rust-lang/rust-analyzer
macro_rules! semantic highlighting
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
It would be nice to have semantic highlighting for macro_rules! in regards to metavariables( and maybe fragment types) as well as repetitions.
macro_rules! mac {
( $metavar:ident $( bar $baz:ident)+ ) => {}
}
The question is whether the dollar $ should be be highlighted as a metavariable or a punctuation character. In regards to $( bar $baz:ident)+, if the punctuations are highlighted as mere punctuations then repetitions won't really have anything that would allow them to be lit.
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 tracing rust-analyzer's semantic-highlighting handling for macro_rules! metavariables, fragment types, and repetitions. Review how the $ and repetition punctuation are currently classified, then determine the intended token categories and verify the resulting highlighting with focused tests. Done means these macro constructs receive consistent semantic highlighting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100