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
flycheck
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
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
proc_macro_srv
proc_macro_test
profile
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
toolchain
tt
vfs Avoid duplicating VfsPath in vfs::path_interner::PathInterner by using an IndexSet 2021-04-06 16:03:57 +03:00
vfs-notify