@@ -141,7 +141,7 @@ struct Point<'a> {
141141
142142[discrete]
143143=== `add_missing_match_arms`
144- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/add_missing_match_arms.rs#L15 [add_missing_match_arms.rs]
144+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/add_missing_match_arms.rs#L16 [add_missing_match_arms.rs]
145145
146146Adds missing clauses to a `match` expression.
147147
@@ -583,7 +583,7 @@ fn qux(bar: Bar, baz: Baz) {}
583583
584584[discrete]
585585=== `extract_function`
586- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_function.rs#L33 [extract_function.rs]
586+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_function.rs#L38 [extract_function.rs]
587587
588588Extracts selected statements into new function.
589589
@@ -854,6 +854,47 @@ impl Default for Example {
854854```
855855
856856
857+ [discrete]
858+ === `generate_delegate_methods`
859+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_delegate_methods.rs#L10[generate_delegate_methods.rs]
860+
861+ Generate delegate methods.
862+
863+ .Before
864+ ```rust
865+ struct Age(u8);
866+ impl Age {
867+ fn age(&self) -> u8 {
868+ self.0
869+ }
870+ }
871+
872+ struct Person {
873+ ag┃e: Age,
874+ }
875+ ```
876+
877+ .After
878+ ```rust
879+ struct Age(u8);
880+ impl Age {
881+ fn age(&self) -> u8 {
882+ self.0
883+ }
884+ }
885+
886+ struct Person {
887+ age: Age,
888+ }
889+
890+ impl Person {
891+ ┃fn age(&self) -> u8 {
892+ self.age.age()
893+ }
894+ }
895+ ```
896+
897+
857898[discrete]
858899=== `generate_deref`
859900**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_deref.rs#L15[generate_deref.rs]
@@ -1645,6 +1686,40 @@ fn t() {}
16451686```
16461687
16471688
1689+ [discrete]
1690+ === `promote_local_to_const`
1691+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/promote_local_to_const.rs#L19[promote_local_to_const.rs]
1692+
1693+ Promotes a local variable to a const item changing its name to a `SCREAMING_SNAKE_CASE` variant
1694+ if the local uses no non-const expressions.
1695+
1696+ .Before
1697+ ```rust
1698+ fn main() {
1699+ let foo┃ = true;
1700+
1701+ if foo {
1702+ println!("It's true");
1703+ } else {
1704+ println!("It's false");
1705+ }
1706+ }
1707+ ```
1708+
1709+ .After
1710+ ```rust
1711+ fn main() {
1712+ const ┃FOO: bool = true;
1713+
1714+ if FOO {
1715+ println!("It's true");
1716+ } else {
1717+ println!("It's false");
1718+ }
1719+ }
1720+ ```
1721+
1722+
16481723[discrete]
16491724=== `pull_assignment_up`
16501725**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/pull_assignment_up.rs#L11[pull_assignment_up.rs]
@@ -1955,7 +2030,7 @@ fn compute() -> Option<i32> { None }
19552030
19562031[discrete]
19572032=== `replace_match_with_if_let`
1958- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_if_let_with_match.rs#L158 [replace_if_let_with_match.rs]
2033+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_if_let_with_match.rs#L160 [replace_if_let_with_match.rs]
19592034
19602035Replaces a binary `match` with a wildcard pattern and no guards with an `if let` expression.
19612036
@@ -2223,6 +2298,23 @@ fn foo() {
22232298```
22242299
22252300
2301+ [discrete]
2302+ === `unwrap_result_return_type`
2303+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/unwrap_result_return_type.rs#L9[unwrap_result_return_type.rs]
2304+
2305+ Unwrap the function's return type.
2306+
2307+ .Before
2308+ ```rust
2309+ fn foo() -> Result<i32>┃ { Ok(42i32) }
2310+ ```
2311+
2312+ .After
2313+ ```rust
2314+ fn foo() -> i32 { 42i32 }
2315+ ```
2316+
2317+
22262318[discrete]
22272319=== `wrap_return_type_in_result`
22282320**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/wrap_return_type_in_result.rs#L11[wrap_return_type_in_result.rs]
0 commit comments