rust-analyzer/crates
bors[bot] bf77850c81
Merge #3542
3542: Renames work on struct field shorthands r=matklad a=m-n

When renaming either a local or a struct field, struct field shorthands are now renamed correctly.

Happy to refactor this if it doesn't fit the design of the code. Thanks for adding the suggestion of where to start on the issue.

I wasn't sure if I should also look at the behavior of renaming when placing the cursor at the field shorthand; the following describes the behavior with this patch:

```rust
#[test]
fn test_rename_field_shorthand_for_unspecified() {
    // when renaming a shorthand, should we have a way to specify
    // between renaming the field and the local?
    //
    // If not is this the correct default?
    test_rename(
        r#"
struct Foo {
    i: i32,
}
 impl Foo {
    fn new(i: i32) -> Self {
        Self { i<|> }
    }
}
"#,
        "j",
        r#"
struct Foo {
    i: i32,
}
 impl Foo {
    fn new(j: i32) -> Self {
        Self { i: j }
    }
}
"#,
    );
}
```
Resolves #3431

Co-authored-by: Matt Niemeir <matt.niemeir@gmail.com>
2020-03-11 09:22:09 +00:00
..
ra_arena Switch to variant-granularity field type inference 2019-11-25 00:12:36 +03:00
ra_assists Rerail split_import API onto AST 2020-03-06 14:08:43 +01:00
ra_cargo_watch Merge #3533 2020-03-09 14:38:20 +00:00
ra_cfg Update versions 2020-02-18 16:12:40 +02:00
ra_db Add fixture meta for single file fixture 2020-03-11 00:45:03 +08:00
ra_fmt When joining lines, unwrap trivial diverging blocks 2020-02-24 17:17:05 +01:00
ra_hir Simplify 2020-03-09 11:19:03 +01:00
ra_hir_def Updates insta to 0.15.0 and bumps console to 0.10.0 2020-03-09 10:28:30 -04:00
ra_hir_expand Merge #3513 2020-03-09 08:56:58 +00:00
ra_hir_ty Fix completion with a partially unknown type 2020-03-10 21:02:13 +01:00
ra_ide Merge #3542 2020-03-11 09:22:09 +00:00
ra_ide_db Merge #3542 2020-03-11 09:22:09 +00:00
ra_mbe Merge #3513 2020-03-09 08:56:58 +00:00
ra_parser Implement concat macro 2020-03-04 01:21:14 +08:00
ra_prof Allow specifying additional info on call to profile 2020-03-06 17:36:51 +01:00
ra_project_model Consider crate declaration names 2020-03-08 23:00:50 +02:00
ra_syntax Add parse_to_token_tree 2020-03-09 00:13:04 +08:00
ra_text_edit Remove unused dependencies 2020-02-27 14:04:13 +09:00
ra_tt Update versions 2020-02-18 16:12:40 +02:00
rust-analyzer Move FeatureFlags 2020-03-10 18:56:15 +01:00
test_utils Check only one fixture 2020-03-11 00:45:03 +08:00