rust-analyzer/crates
bors[bot] 02a3d898e4
Merge #10076
10076: Use struct init shorthand when applicable in fill struct fields assist r=matklad a=nathanwhit

This PR tweaks the fill struct fields assist to use the struct init shorthand when a local variable with a matching name and type is in scope.

For example:
```rust
struct Foo {
    a: usize,
    b: i32,
    c: char,
}

fn main() {
    let a = 1;
    let b = 2;
    let c = 3;
    let foo = Foo { <|> };
}
```
Before we would insert
```rust
Foo {
    a: (),
    b: (),
    c: (),
}
```
now we would insert
```rust
Foo {
    a,
    b,
    c: ()
}
```

Co-authored-by: nathan.whitaker <nathan.whitaker01@gmail.com>
2021-08-30 18:55:18 +00:00
..
base_db feat: include full path in the cyclic deps error 2021-08-18 15:35:04 +03:00
cfg internal: remove useless helpers 2021-08-09 15:58:21 +03:00
flycheck switch log crate to tracing 2021-08-30 15:11:42 +08:00
hir switch log crate to tracing 2021-08-30 15:11:42 +08:00
hir_def switch log crate to tracing 2021-08-30 15:11:42 +08:00
hir_expand fail -> failed 2021-08-30 02:47:10 -07:00
hir_ty switch log crate to tracing 2021-08-30 15:11:42 +08:00
ide internal: more obviously correct code for cache priming progerss 2021-08-30 19:18:48 +03:00
ide_assists Merge #10015 2021-08-30 08:34:49 +00:00
ide_completion switch log crate to tracing 2021-08-30 15:11:42 +08:00
ide_db switch log crate to tracing 2021-08-30 15:11:42 +08:00
ide_diagnostics Merge #10076 2021-08-30 18:55:18 +00:00
ide_ssr fix: avoid pathological macro expansions 2021-08-09 16:15:02 +03:00
limit internal: add API to check what are the max limits in practice 2021-07-31 18:26:43 +03:00
mbe switch log crate to tracing 2021-08-30 15:11:42 +08:00
parser internal: improve style 2021-08-30 15:55:40 +03:00
paths internal: improve compilation critical path a bit 2021-08-28 22:43:37 +03:00
proc_macro_api switch log crate to tracing 2021-08-30 15:11:42 +08:00
proc_macro_srv internal: improve compilation critical path a bit 2021-08-28 22:43:37 +03:00
proc_macro_test cargo_metadata 0.14 2021-07-09 11:01:55 -04:00
profile internal: make non-zero times stand out in profile 2021-07-31 16:22:03 +03:00
project_model Merge #10005 2021-08-30 08:42:13 +00:00
rust-analyzer feat: improve CPU usage 2021-08-30 19:48:16 +03:00
sourcegen minor: make sure that project_root works correctly 2021-07-13 15:02:29 +03:00
stdx Remove proc macro management thread 2021-07-08 16:43:39 +02:00
syntax Merge #10085 2021-08-30 12:57:39 +00:00
test_utils Refactor & improve handling of overloaded binary operators 2021-08-22 17:35:50 +02:00
text_edit Handle all rename special cases for all record pattern fields 2021-08-16 22:48:38 +02:00
toolchain minor: drop dummy authors field 2021-07-05 14:19:41 +03:00
tt remove unused serde feature from smol_str 2021-08-28 22:43:37 +03:00
vfs internal: document that ascription is preferred to a turbo fish 2021-08-11 14:16:15 +03:00
vfs-notify switch log crate to tracing 2021-08-30 15:11:42 +08:00