rust-lang / rust-lang/rust-analyzer

Syntax highlighting for macros

Open
#10,281 7 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-highlighting A-macro C-feature E-hard fun S-unactionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

Very far-fetch with little logic behind it

Syntax highlighting inside of macros. Something parses the content inside a macro, and theoretically speaking this could be used for syntax highlighting inside of a macro.

For example, take the xflags macro. This crate has its own syntactical sugar inside of the macro, and syntax highlighting for it would be cool. Theoretically, it just has to parse how the macro is defined and send that back to the editor, but it is probably more complex than that.

Not sure how this would work with proc-macros.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by investigating how the xflags macro definition could expose its inner syntax to the editor, including how proc-macros would fit. Done would require a concrete design and implementation path for macro-body syntax 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
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.