|
2 | 2 |
|
3 | 3 | [discrete]
|
4 | 4 | === `add_explicit_type`
|
5 |
| -**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/add_explicit_type.rs#L9[add_explicit_type.rs] |
| 5 | +**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/add_explicit_type.rs#L6[add_explicit_type.rs] |
6 | 6 |
|
7 | 7 | Specify type for a let binding.
|
8 | 8 |
|
@@ -407,7 +407,7 @@ fn qux(bar: Bar, baz: Baz) {}
|
407 | 407 |
|
408 | 408 | [discrete]
|
409 | 409 | === `extract_function`
|
410 |
| -**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_function.rs#L28[extract_function.rs] |
| 410 | +**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/extract_function.rs#L31[extract_function.rs] |
411 | 411 |
|
412 | 412 | Extracts selected statements into new function.
|
413 | 413 |
|
@@ -860,7 +860,7 @@ impl From<u32> for A {
|
860 | 860 |
|
861 | 861 | [discrete]
|
862 | 862 | === `generate_function`
|
863 |
| -**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_function.rs#L19[generate_function.rs] |
| 863 | +**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_function.rs#L20[generate_function.rs] |
864 | 864 |
|
865 | 865 | Adds a stub function with a signature matching the function under the cursor.
|
866 | 866 |
|
@@ -891,7 +891,7 @@ fn bar(arg: &str, baz: Baz) ${0:-> ()} {
|
891 | 891 |
|
892 | 892 | [discrete]
|
893 | 893 | === `generate_getter`
|
894 |
| -**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_getter.rs#L9[generate_getter.rs] |
| 894 | +**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_getter.rs#L10[generate_getter.rs] |
895 | 895 |
|
896 | 896 | Generate a getter method.
|
897 | 897 |
|
@@ -919,7 +919,7 @@ impl Person {
|
919 | 919 |
|
920 | 920 | [discrete]
|
921 | 921 | === `generate_getter_mut`
|
922 |
| -**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_getter.rs#L35[generate_getter.rs] |
| 922 | +**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/generate_getter.rs#L36[generate_getter.rs] |
923 | 923 |
|
924 | 924 | Generate a mut getter method.
|
925 | 925 |
|
@@ -1156,8 +1156,7 @@ impl<'a> Cursor<'a> {
|
1156 | 1156 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/invert_if.rs#L12[invert_if.rs]
|
1157 | 1157 |
|
1158 | 1158 | This transforms if expressions of the form `if !x {A} else {B}` into `if x {B} else {A}`
|
1159 |
| -This also works with `!=`. This assist can only be applied with the cursor |
1160 |
| -on `if`. |
| 1159 | +This also works with `!=`. This assist can only be applied with the cursor on `if`. |
1161 | 1160 |
|
1162 | 1161 | .Before
|
1163 | 1162 | ```rust
|
@@ -1570,6 +1569,27 @@ impl Foo for Bar {
|
1570 | 1569 | ```
|
1571 | 1570 |
|
1572 | 1571 |
|
| 1572 | +[discrete] |
| 1573 | +=== `replace_char_with_string` |
| 1574 | +**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_string_with_char.rs#L51[replace_string_with_char.rs] |
| 1575 | + |
| 1576 | +Replace a char literal with a string literal. |
| 1577 | + |
| 1578 | +.Before |
| 1579 | +```rust |
| 1580 | +fn main() { |
| 1581 | + find('{┃'); |
| 1582 | +} |
| 1583 | +``` |
| 1584 | + |
| 1585 | +.After |
| 1586 | +```rust |
| 1587 | +fn main() { |
| 1588 | + find("{"); |
| 1589 | +} |
| 1590 | +``` |
| 1591 | + |
| 1592 | + |
1573 | 1593 | [discrete]
|
1574 | 1594 | === `replace_derive_with_manual_impl`
|
1575 | 1595 | **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_derive_with_manual_impl.rs#L19[replace_derive_with_manual_impl.rs]
|
@@ -1752,9 +1772,9 @@ fn process(map: HashMap<String, String>) {}
|
1752 | 1772 |
|
1753 | 1773 | [discrete]
|
1754 | 1774 | === `replace_string_with_char`
|
1755 |
| -**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_string_with_char.rs#L5[replace_string_with_char.rs] |
| 1775 | +**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/replace_string_with_char.rs#L11[replace_string_with_char.rs] |
1756 | 1776 |
|
1757 |
| -Replace string with char. |
| 1777 | +Replace string literal with char literal. |
1758 | 1778 |
|
1759 | 1779 | .Before
|
1760 | 1780 | ```rust
|
|
0 commit comments