rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

When using code actions for quick fix, multiple possible options were not split

Open A4-Tacks opened this issue 1 year ago • 0 comments

use std;

fn main() {
    let x = vec![[2]];
    let s: &[i32] = x.iter().map(Deref::deref).next().unwrap();
}

in line 1 use CodeAction

1. remove the whole `use` item                                                │
2. Change visibility to pub(crate)                                            │
3. Remove all the unused imports                                              │
4. consider importing one of these items: `use core::ops::Deref;<00>`, `use   │
crate::std::ops::Deref;<00>`, `use std::ops::Deref;<00>`                      │

expect

1. remove the whole `use` item                                                │
2. Change visibility to pub(crate)                                            │
3. Remove all the unused imports                                              │
4. consider importing `use core::ops::Deref;`                                 │
5. consider importing `use crate::std::ops::Deref;`                           │
6. consider importing `use std::ops::Deref;`                                  │

rust-analyzer version: rust-analyzer 1.78.0-nightly (bccb9bb 2024-02-16)

rustc version: rustc 1.78.0-nightly (bccb9bbb4 2024-02-16)

relevant settings: NONE

A4-Tacks avatar Feb 23 '24 07:02 A4-Tacks