rust-lang / rust-lang/rust-analyzer

Autocomplete of enum variants does not work in `vec![Enum_::|]` context

Open
#13,231 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

enum En {
    Foo,
    Bar,
}

fn yolo() {
    // autocomplete works
    let p = En::Foo;

    // autocomplete do not works
    let p = vec![En::|];
}

rust-analyzer version: latest master 0.0.0 (f64c95600 2022-09-12)

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 reported reproduction in the issue body and trace autocomplete handling for the vec![En::|] macro context, comparing it with the working En::Foo expression. Confirm the fix by checking that enum variants are suggested inside the vector macro invocation.

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
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.