rust-lang / rust-lang/rust-analyzer
Combining let statements into a pattern
Open
Nobody has claimed this yet.
A-assists
C-feature
S-actionable
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
A nice little code action would be combining multiple let statements into a single one, like this
// Original code
let mut body = builder.translate(theta.body());
let mut outputs = BTreeMap::new();
// Code action turns it into this
let (mut body, mut outputs) = (builder.translate(theta.body()), BTreeMap::new());
The inverse would also be cool, splitting patterns into multiple bindings
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
The issue names no files or tests. Start by locating rust-analyzer’s existing code-action entry points and tests for let bindings, then assess both combining separate bindings into a tuple pattern and splitting tuple patterns into bindings. Done means both transformations behave correctly and are covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100