@@ -726,6 +726,41 @@ fn qux(bar: Bar, baz: Baz) {}
726726```
727727
728728
729+ [discrete]
730+ === `extract_expressions_from_format_string`
731+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_expressions_from_format_string.rs#L13[extract_expressions_from_format_string.rs]
732+
733+ Move an expression out of a format string.
734+
735+ .Before
736+ ```rust
737+ macro_rules! format_args {
738+ ($lit:literal $(tt:tt)*) => { 0 },
739+ }
740+ macro_rules! print {
741+ ($($arg:tt)*) => (std::io::_print(format_args!($($arg)*)));
742+ }
743+
744+ fn main() {
745+ print!("{var} {x + 1}┃");
746+ }
747+ ```
748+
749+ .After
750+ ```rust
751+ macro_rules! format_args {
752+ ($lit:literal $(tt:tt)*) => { 0 },
753+ }
754+ macro_rules! print {
755+ ($($arg:tt)*) => (std::io::_print(format_args!($($arg)*)));
756+ }
757+
758+ fn main() {
759+ print!("{var} {}"┃, x + 1);
760+ }
761+ ```
762+
763+
729764[discrete]
730765=== `extract_function`
731766**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_function.rs#L38[extract_function.rs]
@@ -812,7 +847,7 @@ enum A { One(One) }
812847
813848[discrete]
814849=== `extract_type_alias`
815- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_type_alias.rs#L10 [extract_type_alias.rs]
850+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_type_alias.rs#L7 [extract_type_alias.rs]
816851
817852Extracts the selected type as a type alias.
818853
@@ -1325,7 +1360,7 @@ fn main() {
13251360
13261361[discrete]
13271362=== `generate_from_impl_for_enum`
1328- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_from_impl_for_enum.rs#L6 [generate_from_impl_for_enum.rs]
1363+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_from_impl_for_enum.rs#L8 [generate_from_impl_for_enum.rs]
13291364
13301365Adds a From impl for this enum variant with one tuple field.
13311366
@@ -1661,6 +1696,43 @@ fn main() {
16611696```
16621697
16631698
1699+ [discrete]
1700+ === `inline_macro`
1701+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_macro.rs#L5[inline_macro.rs]
1702+
1703+ Takes a macro and inlines it one step.
1704+
1705+ .Before
1706+ ```rust
1707+ macro_rules! num {
1708+ (+$($t:tt)+) => (1 + num!($($t )+));
1709+ (-$($t:tt)+) => (-1 + num!($($t )+));
1710+ (+) => (1);
1711+ (-) => (-1);
1712+ }
1713+
1714+ fn main() {
1715+ let number = num┃!(+ + + - + +);
1716+ println!("{number}");
1717+ }
1718+ ```
1719+
1720+ .After
1721+ ```rust
1722+ macro_rules! num {
1723+ (+$($t:tt)+) => (1 + num!($($t )+));
1724+ (-$($t:tt)+) => (-1 + num!($($t )+));
1725+ (+) => (1);
1726+ (-) => (-1);
1727+ }
1728+
1729+ fn main() {
1730+ let number = 1+num!(+ + - + +);
1731+ println!("{number}");
1732+ }
1733+ ```
1734+
1735+
16641736[discrete]
16651737=== `inline_type_alias`
16661738**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_type_alias.rs#L105[inline_type_alias.rs]
@@ -1980,41 +2052,6 @@ impl S {
19802052```
19812053
19822054
1983- [discrete]
1984- === `move_format_string_arg`
1985- **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/move_format_string_arg.rs#L13[move_format_string_arg.rs]
1986-
1987- Move an expression out of a format string.
1988-
1989- .Before
1990- ```rust
1991- macro_rules! format_args {
1992- ($lit:literal $(tt:tt)*) => { 0 },
1993- }
1994- macro_rules! print {
1995- ($($arg:tt)*) => (std::io::_print(format_args!($($arg)*)));
1996- }
1997-
1998- fn main() {
1999- print!("{x + 1}┃");
2000- }
2001- ```
2002-
2003- .After
2004- ```rust
2005- macro_rules! format_args {
2006- ($lit:literal $(tt:tt)*) => { 0 },
2007- }
2008- macro_rules! print {
2009- ($($arg:tt)*) => (std::io::_print(format_args!($($arg)*)));
2010- }
2011-
2012- fn main() {
2013- print!("{}"┃, x + 1);
2014- }
2015- ```
2016-
2017-
20182055[discrete]
20192056=== `move_from_mod_rs`
20202057**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/move_from_mod_rs.rs#L12[move_from_mod_rs.rs]
@@ -2412,6 +2449,69 @@ impl Foo for Bar {
24122449```
24132450
24142451
2452+ [discrete]
2453+ === `replace_arith_with_checked`
2454+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_arith_op.rs#L9[replace_arith_op.rs]
2455+
2456+ Replaces arithmetic on integers with the `checked_*` equivalent.
2457+
2458+ .Before
2459+ ```rust
2460+ fn main() {
2461+ let x = 1 ┃+ 2;
2462+ }
2463+ ```
2464+
2465+ .After
2466+ ```rust
2467+ fn main() {
2468+ let x = 1.checked_add(2);
2469+ }
2470+ ```
2471+
2472+
2473+ [discrete]
2474+ === `replace_arith_with_saturating`
2475+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_arith_op.rs#L28[replace_arith_op.rs]
2476+
2477+ Replaces arithmetic on integers with the `saturating_*` equivalent.
2478+
2479+ .Before
2480+ ```rust
2481+ fn main() {
2482+ let x = 1 ┃+ 2;
2483+ }
2484+ ```
2485+
2486+ .After
2487+ ```rust
2488+ fn main() {
2489+ let x = 1.saturating_add(2);
2490+ }
2491+ ```
2492+
2493+
2494+ [discrete]
2495+ === `replace_arith_with_wrapping`
2496+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_arith_op.rs#L50[replace_arith_op.rs]
2497+
2498+ Replaces arithmetic on integers with the `wrapping_*` equivalent.
2499+
2500+ .Before
2501+ ```rust
2502+ fn main() {
2503+ let x = 1 ┃+ 2;
2504+ }
2505+ ```
2506+
2507+ .After
2508+ ```rust
2509+ fn main() {
2510+ let x = 1.wrapping_add(2);
2511+ }
2512+ ```
2513+
2514+
24152515[discrete]
24162516=== `replace_char_with_string`
24172517**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_string_with_char.rs#L51[replace_string_with_char.rs]
@@ -2884,6 +2984,27 @@ pub async fn bar() { foo() }
28842984```
28852985
28862986
2987+ [discrete]
2988+ === `unqualify_method_call`
2989+ **Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/unqualify_method_call.rs#L8[unqualify_method_call.rs]
2990+
2991+ Transforms universal function call syntax into a method call.
2992+
2993+ .Before
2994+ ```rust
2995+ fn main() {
2996+ std::ops::Add::add┃(1, 2);
2997+ }
2998+ ```
2999+
3000+ .After
3001+ ```rust
3002+ fn main() {
3003+ 1.add(2);
3004+ }
3005+ ```
3006+
3007+
28873008[discrete]
28883009=== `unwrap_block`
28893010**Source:** https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/unwrap_block.rs#L11[unwrap_block.rs]
0 commit comments