rust/crates
bors[bot] 5be653d426
Merge #9108
9108: Don't show extract into variable assist for unit expressions r=jonas-schievink a=brandondong

**Reproduction:**

```rust
fn main() {
    let mut i = 3;
    $0if i >= 0 {
        i += 1;
    } else {
        i -= 1;
    }$0
}
```

1. Select the snippet of code between the $0's.
2. The extract into variable assist shows up, pushing down the more useful extract into function assist.
3. The resulting output of selecting the extract into variable assist is valid but with the extracted variable having the unit type:
```rust
fn main() {
    let mut i = 3;
    let var_name = if i >= 0 {
        i += 1;
    } else {
        i -= 1;
    };
    var_name
}
```

**Fix:**
- Don't show the extract into variable assist for unit expressions. I could not think of any scenarios where such a variable extraction would be desired.

Co-authored-by: Brandon <brandondong604@hotmail.com>
2021-06-02 17:25:11 +00:00
..
base_db Merge #8866 2021-05-31 12:42:32 +00:00
cfg internal: expose cfg attrs from hir::Crate 2021-05-07 23:50:24 +03:00
flycheck Use package root as cargo check working directory 2021-05-12 19:50:52 -07:00
hir Merge #8866 2021-05-31 12:42:32 +00:00
hir_def Fall back to legacy prelude 2021-06-01 19:03:00 +02:00
hir_expand Fall back to legacy prelude 2021-06-01 19:03:00 +02:00
hir_ty Implement per-edition preludes 2021-06-01 13:39:19 +02:00
ide Merge #8952 2021-05-31 15:48:41 +00:00
ide_assists Merge #9108 2021-06-02 17:25:11 +00:00
ide_completion Remove obsolete is_new_item field on CompletionContext 2021-06-02 17:12:36 +02:00
ide_db Implement per-edition preludes 2021-06-01 13:39:19 +02:00
ide_ssr syntax: return owned string instead of leaking string 2021-03-26 18:30:59 +01:00
mbe Treat pat_param like pat fragments 2021-05-29 18:32:32 +02:00
parser Add even more docs 2021-05-22 17:20:22 +03:00
paths Clearer naming 2021-04-06 16:22:26 +03:00
proc_macro_api Disable unaliged feature of object 2021-05-24 16:35:52 +03:00
proc_macro_srv Use cargo check again 2021-05-31 18:58:36 +02:00
proc_macro_test Simplify proc_macro_srv tests 2021-05-31 17:32:56 +02:00
profile Add more docs 2021-05-22 16:53:47 +03:00
project_model clippy::redundant_clone fixes 2021-05-26 18:34:50 +03:00
rust-analyzer Merge #9039 2021-05-31 13:21:31 +00:00
stdx Don't compare ast::Visibility by stringifying 2021-05-20 17:45:59 +02:00
syntax Account for generics in extract_struct_from_enum_variant 2021-06-02 17:44:00 +02:00
test_utils simplify 2021-05-28 20:46:09 +02:00
text_edit Avoid turning completion objects into builders 2020-11-16 23:16:41 +02:00
toolchain Add description for crates that will be published 2020-08-24 13:07:22 +02:00
tt Add more docs 2021-05-22 16:53:47 +03:00
vfs Avoid duplicating VfsPath in vfs::path_interner::PathInterner by using an IndexSet 2021-04-06 16:03:57 +03:00
vfs-notify Fix slow tests sometimes failing 2021-02-12 16:31:16 +01:00