rust-lang / rust-lang/rust-analyzer
Assists do not scale to multiple cursors
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
In VS Code, when I place several cursors on distinct locations that trigger the same set of assists, then picking one of the listed assists results in RA applying the selected assist merely to the first cursor location. I expected RA to apply the assist individually per cursor position (unless they overlap (?) and excluding other pathological cases).
Examples
Let <|> denote a cursor. To reproduce in VS Code, press Ctrl+. (Quick Fix) and select one of the assists.
fn main() {
// assist: Invert if
<|>if true {} else {}
<|>if true {} else {}
<|>if false {} else {}
}
Outcome:
fn main() {
<|>if false {} else {}
<|>if true {} else {}
<|>if false {} else {}
}
fn main() {
// assist: Convert integer base
<|>413;
<|>10_344;
<|>900;
}
Outcome:
fn main() {
<|>0b110011101;
<|>10_344;
<|>900;
}
I searched thoroughly through the issue tracker (keywords cursor, multiple, assist) but could not find anything related.
rust-analyzer version: 7a17fb9c4 2022-02-13 nightly
rustc version: rustc 1.60.0-nightly (5d8767cb2 2022-02-12)
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 reproducing the issue in VS Code with Ctrl+. using the multi-cursor Rust examples in the report. Trace how rust-analyzer applies a selected assist to cursor locations; done means the assist is applied independently at each applicable cursor without changing unrelated locations.
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
- Clearly specified
- Newbie friendliness
- 35/100