rust-lang / rust-lang/rust-analyzer

`Fill match arms` assist ignores existing variants prefixed with `Self::`

Open
#4,650 3 comments 6 reactions 1 assignee View on GitHub

@ChayimFriedman2 is already working on this.

Since Jun 23, 2025.

A-assists A-pattern C-bug S-actionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

Right now if you have an enum that has some match arms and a match like this:

match x {
    Self::V1 => todo!(),
    Self::V2 => todo!(),
}

and you add a new variant and then run the fill match arms assist it will insert additional copies of V1 and V2 in the match arms that are prefixed with the types own name rather than Self.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.