rust/crates
bors[bot] 3f432730df
Merge #8467
8467: Adds impl Deref assist r=jhgg a=jhgg

This PR adds a new `generate_deref` assist that automatically generates a deref impl for a given struct field.

Check out this gif:

![2021-04-11_00-33-33](https://user-images.githubusercontent.com/5489149/114296006-b38e1000-9a5d-11eb-9112-807c01b8fd0a.gif)

--

I have a few Q's:
 - [x] Should I write more tests, if so, what precisely should I test for?
 - [x] I have an inline question on line 65, can someone provide guidance? :) 
 - [x] I can implement this for `ast::TupleField` too. But should it be a separate assist fn, or should I try and jam both into the `generate_deref`?
 - [x] I want to follow this up with an assist on `impl $0Deref for T {` which would automatically generate a `DerefMut` impl that mirrors the Deref as well, however, I could probably use some pointers on how to do that, since I'll have to reach into the ast of `fn deref` to grab the field that it's referencing for the `DerefMut` impl. 

Co-authored-by: jake <jh@discordapp.com>
2021-04-19 04:54:04 +00:00
..
base_db Add some more error messages to fixture failure cases 2021-04-17 21:34:14 +02:00
cfg Make ast_to_token_tree infallible 2021-04-04 01:46:45 +02:00
flycheck Bump cargo_metadata 2021-03-02 14:27:29 +02:00
hir Exclude inherent traits from flyimports 2021-04-16 11:13:17 +03:00
hir_def Fix visibility of items in block modules 2021-04-19 01:06:04 +02:00
hir_expand Expand global_asm! to nothing 2021-04-18 18:43:45 +02:00
hir_ty Collect inherent impls in unnamed consts 2021-04-19 01:06:26 +02:00
ide Accept E<error_number> notation in doctests 2021-04-18 06:15:40 +03:00
ide_assists Merge #8467 2021-04-19 04:54:04 +00:00
ide_completion Exclude inherent traits from flyimports 2021-04-16 11:13:17 +03:00
ide_db Merge #8467 2021-04-19 04:54:04 +00:00
ide_ssr syntax: return owned string instead of leaking string 2021-03-26 18:30:59 +01:00
mbe Merge #8560 2021-04-18 02:14:27 +00:00
parser Handle extended key value attr in mbe 2021-04-17 14:31:52 +08:00
paths Clearer naming 2021-04-06 16:22:26 +03:00
proc_macro_api Trim down IPC json size 2021-03-24 15:01:37 +08:00
proc_macro_srv Fix parse u128 bug in proc-macro 2021-03-31 19:50:36 +08:00
proc_macro_test Add description for crates that will be published 2020-08-24 13:07:22 +02:00
profile internal: revive google_cpu_profile infra 2021-03-30 17:29:43 +03:00
project_model feat: avoid checking the whole project during initial loading 2021-04-12 15:29:31 +03:00
rust-analyzer Accept E<error_number> notation in doctests 2021-04-18 06:15:40 +03:00
stdx feat: show errors from cargo metadata and initial cargo check in the status bar 2021-04-06 18:08:05 +03:00
syntax nail rowan version down 2021-04-17 09:31:54 +02:00
test_utils internal: fix flakiness of accidentally quadratic test 2021-04-13 12:56:24 +03: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 a lot of clippy::style fixes 2021-03-21 16:15:41 +01: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