rust-lang / rust-lang/rust-analyzer

Complete in macro_rules declaration location

Open
#21,802 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-completion A-macro C-feature C-tracking-issue
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

macro_rules! foo {
    ($x:expr) => {$x + $0};
}
const NUM: i32 = 2;
const _: () = foo!(3);
  • Complete paths after $crate::
  • Complete at token descend (macro_rules first expansion)
    • Complete expressions in macro_rules declaration body
    • Complete statements in macro_rules declaration body
    • Complete pattern in macro_rules declaration body
  • Complete at define site (decl macro 2.0)

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

Start with the macro_rules declaration location and the example showing completion after $0. Trace how rust-analyzer handles the first macro expansion and completion in expressions, statements, patterns, $crate paths, and declaration macro 2.0 define sites. Done means the checklist cases are supported and verified with corresponding completion coverage.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.