rust-lang / rust-lang/rust-analyzer
Prioritize items that return an enum when requesting completion in a pattern match
Open
Nobody has claimed this yet.
A-completion
C-feature
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 69
Description
struct S {
field1: u32,
field2: Option<u32>,
field3: Result<u32, u32>,
}
let my_s = S {
field1: 42,
field2: Some(42),
field3: Ok(42),
};
match my_s. // When asked for completions in this position it should prioritize fields or methods that return options.
This should generalize to matches!. This already works well for let Some() and if let Some()
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 existing completion behavior for let Some() and if let Some() contexts, then compare it with pattern-match and matches! completion. Done means fields or methods returning Option or Result are prioritized in the relevant completion results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100