diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-15 07:01:19 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-15 07:01:19 +0000 |
commit | 3ad11973ac7596323f085a9fcb9530e47f021c41 (patch) | |
tree | 15d397d8732ddd5511f85f45689fb5b32441e36f /crates/ra_assists/src/lib.rs | |
parent | a6d080608db1bcc2a2f8fc586d8a5d3c85e50763 (diff) | |
parent | cbc6f94573d7f4601b739e001de5d5f71ec9b552 (diff) |
Merge #2165
2165: ra_assists: Add add_new assist r=matklad a=rep-nop
Adds a new assist to autogenerate a new fn based on the selected struct, excluding tuple structs and unions. The fn will inherit the same visibility as the struct and the assist will attempt to reuse any existing impl blocks that exist at the same level of struct.
Not marking this as closing #1644 since there's a part 2 of adding autocompletion for when someone starts typing `[pub ]fn new(...`
Co-authored-by: Wesley Norris <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/lib.rs')
-rw-r--r-- | crates/ra_assists/src/lib.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs index 39c1c283f..f2f0dacbf 100644 --- a/crates/ra_assists/src/lib.rs +++ b/crates/ra_assists/src/lib.rs | |||
@@ -95,6 +95,7 @@ mod assists { | |||
95 | mod add_derive; | 95 | mod add_derive; |
96 | mod add_explicit_type; | 96 | mod add_explicit_type; |
97 | mod add_impl; | 97 | mod add_impl; |
98 | mod add_new; | ||
98 | mod apply_demorgan; | 99 | mod apply_demorgan; |
99 | mod flip_comma; | 100 | mod flip_comma; |
100 | mod flip_binexpr; | 101 | mod flip_binexpr; |
@@ -119,6 +120,7 @@ mod assists { | |||
119 | add_derive::add_derive, | 120 | add_derive::add_derive, |
120 | add_explicit_type::add_explicit_type, | 121 | add_explicit_type::add_explicit_type, |
121 | add_impl::add_impl, | 122 | add_impl::add_impl, |
123 | add_new::add_new, | ||
122 | apply_demorgan::apply_demorgan, | 124 | apply_demorgan::apply_demorgan, |
123 | change_visibility::change_visibility, | 125 | change_visibility::change_visibility, |
124 | fill_match_arms::fill_match_arms, | 126 | fill_match_arms::fill_match_arms, |