@@ -460,6 +460,33 @@ fn main() {
460460```
461461
462462
463+ [discrete]
464+ === `convert_closure_to_fn`
465+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_closure_to_fn.rs#L25[convert_closure_to_fn.rs]
466+
467+ This converts a closure to a freestanding function, changing all captures to parameters.
468+
469+ .Before
470+ ```rust
471+ fn main() {
472+ let mut s = String::new();
473+ let closure = |┃a| s.push_str(a);
474+ closure("abc");
475+ }
476+ ```
477+
478+ .After
479+ ```rust
480+ fn main() {
481+ let mut s = String::new();
482+ fn closure(a: &str, s: &mut String) {
483+ s.push_str(a)
484+ }
485+ closure("abc", &mut s);
486+ }
487+ ```
488+
489+
463490[discrete]
464491=== `convert_for_loop_with_for_each`
465492**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_iter_for_each_to_for.rs#L76[convert_iter_for_each_to_for.rs]
@@ -1029,6 +1056,33 @@ fn qux(bar: Bar, baz: Baz) {}
10291056```
10301057
10311058
1059+ [discrete]
1060+ === `explicit_enum_discriminant`
1061+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/explicit_enum_discriminant.rs#L11[explicit_enum_discriminant.rs]
1062+
1063+ Adds explicit discriminant to all enum variants.
1064+
1065+ .Before
1066+ ```rust
1067+ enum TheEnum┃ {
1068+ Foo,
1069+ Bar,
1070+ Baz = 42,
1071+ Quux,
1072+ }
1073+ ```
1074+
1075+ .After
1076+ ```rust
1077+ enum TheEnum {
1078+ Foo = 0,
1079+ Bar = 1,
1080+ Baz = 42,
1081+ Quux = 43,
1082+ }
1083+ ```
1084+
1085+
10321086[discrete]
10331087=== `extract_expressions_from_format_string`
10341088**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_expressions_from_format_string.rs#L14[extract_expressions_from_format_string.rs]
@@ -1173,7 +1227,7 @@ fn main() {
11731227.After
11741228```rust
11751229fn main() {
1176- let ┃var_name = ( 1 + 2) ;
1230+ let ┃var_name = 1 + 2;
11771231 var_name * 4;
11781232}
11791233```
@@ -1254,7 +1308,7 @@ fn main() {
12541308
12551309[discrete]
12561310=== `flip_comma`
1257- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/flip_comma.rs#L5 [flip_comma.rs]
1311+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/flip_comma.rs#L9 [flip_comma.rs]
12581312
12591313Flips two comma-separated items.
12601314
@@ -1849,7 +1903,7 @@ impl Person {
18491903
18501904[discrete]
18511905=== `generate_impl`
1852- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L8 [generate_impl.rs]
1906+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L20 [generate_impl.rs]
18531907
18541908Adds a new inherent impl for a type.
18551909
@@ -2061,7 +2115,7 @@ impl<const N: usize> ${0:NewTrait}<N> for Foo<N> {
20612115
20622116[discrete]
20632117=== `generate_trait_impl`
2064- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L59 [generate_impl.rs]
2118+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L66 [generate_impl.rs]
20652119
20662120Adds a new trait impl for a type.
20672121
@@ -3581,6 +3635,31 @@ fn arithmetics {
35813635```
35823636
35833637
3638+ [discrete]
3639+ === `toggle_macro_delimiter`
3640+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/toggle_macro_delimiter.rs#L9[toggle_macro_delimiter.rs]
3641+
3642+ Change macro delimiters in the order of `( -> { -> [ -> (`.
3643+
3644+ .Before
3645+ ```rust
3646+ macro_rules! sth {
3647+ () => {};
3648+ }
3649+
3650+ sth!┃( );
3651+ ```
3652+
3653+ .After
3654+ ```rust
3655+ macro_rules! sth {
3656+ () => {};
3657+ }
3658+
3659+ sth!{ }
3660+ ```
3661+
3662+
35843663[discrete]
35853664=== `unmerge_match_arm`
35863665**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/unmerge_match_arm.rs#L10[unmerge_match_arm.rs]
0 commit comments