Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'docs/book/src/assists_generated.md')
-rw-r--r--docs/book/src/assists_generated.md324
1 files changed, 175 insertions, 149 deletions
diff --git a/docs/book/src/assists_generated.md b/docs/book/src/assists_generated.md
index 761a7f859b..9d68a873ff 100644
--- a/docs/book/src/assists_generated.md
+++ b/docs/book/src/assists_generated.md
@@ -1,7 +1,7 @@
//! Generated by `cargo xtask codegen assists-doc-tests`, do not edit by hand.
### `add_braces`
-**Source:** [add_braces.rs](/crates/ide-assists/src/handlers/add_braces.rs#8)
+**Source:** [add_braces.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/add_braces.rs#L8)
Adds braces to lambda and match arm expressions.
@@ -29,7 +29,7 @@ fn foo(n: i32) -> i32 {
### `add_explicit_type`
-**Source:** [add_explicit_type.rs](/crates/ide-assists/src/handlers/add_explicit_type.rs#7)
+**Source:** [add_explicit_type.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/add_explicit_type.rs#L7)
Specify type for a let binding.
@@ -49,7 +49,7 @@ fn main() {
### `add_hash`
-**Source:** [raw_string.rs](/crates/ide-assists/src/handlers/raw_string.rs#89)
+**Source:** [raw_string.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/raw_string.rs#L89)
Adds a hash to a raw string literal.
@@ -69,7 +69,7 @@ fn main() {
### `add_impl_default_members`
-**Source:** [add_missing_impl_members.rs](/crates/ide-assists/src/handlers/add_missing_impl_members.rs#58)
+**Source:** [add_missing_impl_members.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/add_missing_impl_members.rs#L58)
Adds scaffold for overriding default impl members.
@@ -105,7 +105,7 @@ impl Trait for () {
### `add_impl_missing_members`
-**Source:** [add_missing_impl_members.rs](/crates/ide-assists/src/handlers/add_missing_impl_members.rs#16)
+**Source:** [add_missing_impl_members.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/add_missing_impl_members.rs#L16)
Adds scaffold for required impl members.
@@ -141,7 +141,7 @@ impl Trait<u32> for () {
### `add_label_to_loop`
-**Source:** [add_label_to_loop.rs](/crates/ide-assists/src/handlers/add_label_to_loop.rs#9)
+**Source:** [add_label_to_loop.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/add_label_to_loop.rs#L9)
Adds a label to a loop.
@@ -167,7 +167,7 @@ fn main() {
### `add_lifetime_to_type`
-**Source:** [add_lifetime_to_type.rs](/crates/ide-assists/src/handlers/add_lifetime_to_type.rs#5)
+**Source:** [add_lifetime_to_type.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/add_lifetime_to_type.rs#L5)
Adds a new lifetime to a struct, enum or union.
@@ -189,7 +189,7 @@ struct Point<'a> {
### `add_missing_match_arms`
-**Source:** [add_missing_match_arms.rs](/crates/ide-assists/src/handlers/add_missing_match_arms.rs#14)
+**Source:** [add_missing_match_arms.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/add_missing_match_arms.rs#L16)
Adds missing clauses to a `match` expression.
@@ -218,7 +218,7 @@ fn handle(action: Action) {
### `add_return_type`
-**Source:** [add_return_type.rs](/crates/ide-assists/src/handlers/add_return_type.rs#6)
+**Source:** [add_return_type.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/add_return_type.rs#L6)
Adds the return type to a function or closure inferred from its tail expression if it doesn't have a return
type specified. This assists is useable in a functions or closures tail expression or return type position.
@@ -235,7 +235,7 @@ fn foo() -> i32 { 42i32 }
### `add_turbo_fish`
-**Source:** [add_turbo_fish.rs](/crates/ide-assists/src/handlers/add_turbo_fish.rs#14)
+**Source:** [add_turbo_fish.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/add_turbo_fish.rs#L14)
Adds `::<_>` to a call of a generic method or function.
@@ -257,7 +257,7 @@ fn main() {
### `apply_demorgan`
-**Source:** [apply_demorgan.rs](/crates/ide-assists/src/handlers/apply_demorgan.rs#16)
+**Source:** [apply_demorgan.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/apply_demorgan.rs#L16)
Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws).
This transforms expressions of the form `!l || !r` into `!(l && r)`.
@@ -280,7 +280,7 @@ fn main() {
### `apply_demorgan_iterator`
-**Source:** [apply_demorgan.rs](/crates/ide-assists/src/handlers/apply_demorgan.rs#132)
+**Source:** [apply_demorgan.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/apply_demorgan.rs#L132)
Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws) to
`Iterator::all` and `Iterator::any`.
@@ -311,7 +311,7 @@ fn main() {
### `auto_import`
-**Source:** [auto_import.rs](/crates/ide-assists/src/handlers/auto_import.rs#73)
+**Source:** [auto_import.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/auto_import.rs#L73)
If the name is unresolved, provides all possible imports for it.
@@ -333,7 +333,7 @@ fn main() {
### `bind_unused_param`
-**Source:** [bind_unused_param.rs](/crates/ide-assists/src/handlers/bind_unused_param.rs#12)
+**Source:** [bind_unused_param.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/bind_unused_param.rs#L12)
Binds unused function parameter to an underscore.
@@ -351,7 +351,7 @@ fn some_function(x: i32) {
### `bool_to_enum`
-**Source:** [bool_to_enum.rs](/crates/ide-assists/src/handlers/bool_to_enum.rs#29)
+**Source:** [bool_to_enum.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/bool_to_enum.rs#L29)
This converts boolean local variables, fields, constants, and statics into a new
enum with two variants `Bool::True` and `Bool::False`, as well as replacing
@@ -385,7 +385,7 @@ fn main() {
### `change_visibility`
-**Source:** [change_visibility.rs](/crates/ide-assists/src/handlers/change_visibility.rs#13)
+**Source:** [change_visibility.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/change_visibility.rs#L13)
Adds or changes existing visibility specifier.
@@ -401,7 +401,7 @@ pub(crate) fn frobnicate() {}
### `comment_to_doc`
-**Source:** [convert_comment_from_or_to_doc.rs](/crates/ide-assists/src/handlers/convert_comment_from_or_to_doc.rs#9)
+**Source:** [convert_comment_from_or_to_doc.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_comment_from_or_to_doc.rs#L9)
Converts comments to documentation.
@@ -419,7 +419,7 @@ Converts comments to documentation.
### `convert_bool_then_to_if`
-**Source:** [convert_bool_then.rs](/crates/ide-assists/src/handlers/convert_bool_then.rs#131)
+**Source:** [convert_bool_then.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_bool_then.rs#L131)
Converts a `bool::then` method call to an equivalent if expression.
@@ -443,7 +443,7 @@ fn main() {
### `convert_closure_to_fn`
-**Source:** [convert_closure_to_fn.rs](/crates/ide-assists/src/handlers/convert_closure_to_fn.rs#25)
+**Source:** [convert_closure_to_fn.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_closure_to_fn.rs#L25)
This converts a closure to a freestanding function, changing all captures to parameters.
@@ -469,7 +469,7 @@ fn main() {
### `convert_for_loop_with_for_each`
-**Source:** [convert_iter_for_each_to_for.rs](/crates/ide-assists/src/handlers/convert_iter_for_each_to_for.rs#76)
+**Source:** [convert_iter_for_each_to_for.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_iter_for_each_to_for.rs#L76)
Converts a for loop into a for_each loop on the Iterator.
@@ -495,7 +495,7 @@ fn main() {
### `convert_from_to_tryfrom`
-**Source:** [convert_from_to_tryfrom.rs](/crates/ide-assists/src/handlers/convert_from_to_tryfrom.rs#10)
+**Source:** [convert_from_to_tryfrom.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_from_to_tryfrom.rs#L10)
Converts a From impl to a TryFrom impl, wrapping returns in `Ok`.
@@ -527,7 +527,7 @@ impl TryFrom<usize> for Thing {
### `convert_if_to_bool_then`
-**Source:** [convert_bool_then.rs](/crates/ide-assists/src/handlers/convert_bool_then.rs#20)
+**Source:** [convert_bool_then.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_bool_then.rs#L20)
Converts an if expression into a corresponding `bool::then` call.
@@ -551,7 +551,7 @@ fn main() {
### `convert_integer_literal`
-**Source:** [convert_integer_literal.rs](/crates/ide-assists/src/handlers/convert_integer_literal.rs#5)
+**Source:** [convert_integer_literal.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_integer_literal.rs#L5)
Converts the base of integer literals to other bases.
@@ -567,7 +567,7 @@ const _: i32 = 0b1010;
### `convert_into_to_from`
-**Source:** [convert_into_to_from.rs](/crates/ide-assists/src/handlers/convert_into_to_from.rs#8)
+**Source:** [convert_into_to_from.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_into_to_from.rs#L8)
Converts an Into impl to an equivalent From impl.
@@ -597,7 +597,7 @@ impl From<usize> for Thing {
### `convert_iter_for_each_to_for`
-**Source:** [convert_iter_for_each_to_for.rs](/crates/ide-assists/src/handlers/convert_iter_for_each_to_for.rs#11)
+**Source:** [convert_iter_for_each_to_for.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_iter_for_each_to_for.rs#L11)
Converts an Iterator::for_each function into a for loop.
@@ -623,7 +623,7 @@ fn main() {
### `convert_let_else_to_match`
-**Source:** [convert_let_else_to_match.rs](/crates/ide-assists/src/handlers/convert_let_else_to_match.rs#9)
+**Source:** [convert_let_else_to_match.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_let_else_to_match.rs#L9)
Converts let-else statement to let statement and match expression.
@@ -646,7 +646,7 @@ fn main() {
### `convert_match_to_let_else`
-**Source:** [convert_match_to_let_else.rs](/crates/ide-assists/src/handlers/convert_match_to_let_else.rs#12)
+**Source:** [convert_match_to_let_else.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_match_to_let_else.rs#L12)
Converts let statement with match initializer to let-else statement.
@@ -669,7 +669,7 @@ fn foo(opt: Option<()>) {
### `convert_named_struct_to_tuple_struct`
-**Source:** [convert_named_struct_to_tuple_struct.rs](/crates/ide-assists/src/handlers/convert_named_struct_to_tuple_struct.rs#11)
+**Source:** [convert_named_struct_to_tuple_struct.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_named_struct_to_tuple_struct.rs#L11)
Converts struct with named fields to tuple struct, and analogously for enum variants with named
fields.
@@ -714,7 +714,7 @@ impl Point {
### `convert_nested_function_to_closure`
-**Source:** [convert_nested_function_to_closure.rs](/crates/ide-assists/src/handlers/convert_nested_function_to_closure.rs#7)
+**Source:** [convert_nested_function_to_closure.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_nested_function_to_closure.rs#L7)
Converts a function that is defined within the body of another function into a closure.
@@ -742,7 +742,7 @@ fn main() {
### `convert_to_guarded_return`
-**Source:** [convert_to_guarded_return.rs](/crates/ide-assists/src/handlers/convert_to_guarded_return.rs#24)
+**Source:** [convert_to_guarded_return.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_to_guarded_return.rs#L24)
Replace a large conditional with a guarded return.
@@ -769,7 +769,7 @@ fn main() {
### `convert_tuple_return_type_to_struct`
-**Source:** [convert_tuple_return_type_to_struct.rs](/crates/ide-assists/src/handlers/convert_tuple_return_type_to_struct.rs#20)
+**Source:** [convert_tuple_return_type_to_struct.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_tuple_return_type_to_struct.rs#L20)
This converts the return type of a function from a tuple type
into a tuple struct and updates the body accordingly.
@@ -800,7 +800,7 @@ fn foo() -> FooResult {
### `convert_tuple_struct_to_named_struct`
-**Source:** [convert_tuple_struct_to_named_struct.rs](/crates/ide-assists/src/handlers/convert_tuple_struct_to_named_struct.rs#10)
+**Source:** [convert_tuple_struct_to_named_struct.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_tuple_struct_to_named_struct.rs#L10)
Converts tuple struct to struct with named fields, and analogously for tuple enum variants.
@@ -844,7 +844,7 @@ impl Point {
### `convert_two_arm_bool_match_to_matches_macro`
-**Source:** [convert_two_arm_bool_match_to_matches_macro.rs](/crates/ide-assists/src/handlers/convert_two_arm_bool_match_to_matches_macro.rs#8)
+**Source:** [convert_two_arm_bool_match_to_matches_macro.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_two_arm_bool_match_to_matches_macro.rs#L8)
Convert 2-arm match that evaluates to a boolean into the equivalent matches! invocation.
@@ -867,7 +867,7 @@ fn main() {
### `convert_while_to_loop`
-**Source:** [convert_while_to_loop.rs](/crates/ide-assists/src/handlers/convert_while_to_loop.rs#20)
+**Source:** [convert_while_to_loop.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_while_to_loop.rs#L20)
Replace a while with a loop.
@@ -894,7 +894,7 @@ fn main() {
### `destructure_struct_binding`
-**Source:** [destructure_struct_binding.rs](/crates/ide-assists/src/handlers/destructure_struct_binding.rs#18)
+**Source:** [destructure_struct_binding.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/destructure_struct_binding.rs#L18)
Destructures a struct binding in place.
@@ -926,7 +926,7 @@ fn main() {
### `destructure_tuple_binding`
-**Source:** [destructure_tuple_binding.rs](/crates/ide-assists/src/handlers/destructure_tuple_binding.rs#19)
+**Source:** [destructure_tuple_binding.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/destructure_tuple_binding.rs#L19)
Destructures a tuple binding in place.
@@ -948,7 +948,7 @@ fn main() {
### `desugar_async_into_impl_future`
-**Source:** [toggle_async_sugar.rs](/crates/ide-assists/src/handlers/toggle_async_sugar.rs#103)
+**Source:** [toggle_async_sugar.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/toggle_async_sugar.rs#L103)
Rewrites asynchronous function from `async fn` into `-> impl Future`.
This action does not touch the function body and therefore `0`
@@ -970,7 +970,7 @@ pub fn foo() -> impl core::future::Future<Output = usize> {
### `desugar_doc_comment`
-**Source:** [desugar_doc_comment.rs](/crates/ide-assists/src/handlers/desugar_doc_comment.rs#14)
+**Source:** [desugar_doc_comment.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/desugar_doc_comment.rs#L14)
Desugars doc-comments to the attribute form.
@@ -988,7 +988,7 @@ comment"]
### `expand_glob_import`
-**Source:** [expand_glob_import.rs](/crates/ide-assists/src/handlers/expand_glob_import.rs#18)
+**Source:** [expand_glob_import.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/expand_glob_import.rs#L19)
Expands glob imports.
@@ -1017,8 +1017,34 @@ fn qux(bar: Bar, baz: Baz) {}
```
+### `expand_glob_reexport`
+**Source:** [expand_glob_import.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/expand_glob_import.rs#L81)
+
+Expands non-private glob imports.
+
+#### Before
+```rust
+mod foo {
+ pub struct Bar;
+ pub struct Baz;
+}
+
+pub use foo::*┃;
+```
+
+#### After
+```rust
+mod foo {
+ pub struct Bar;
+ pub struct Baz;
+}
+
+pub use foo::{Bar, Baz};
+```
+
+
### `explicit_enum_discriminant`
-**Source:** [explicit_enum_discriminant.rs](/crates/ide-assists/src/handlers/explicit_enum_discriminant.rs#11)
+**Source:** [explicit_enum_discriminant.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/explicit_enum_discriminant.rs#L11)
Adds explicit discriminant to all enum variants.
@@ -1044,7 +1070,7 @@ enum TheEnum {
### `extract_constant`
-**Source:** [extract_variable.rs](/crates/ide-assists/src/handlers/extract_variable.rs#35)
+**Source:** [extract_variable.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L35)
Extracts subexpression into a constant.
@@ -1065,7 +1091,7 @@ fn main() {
### `extract_expressions_from_format_string`
-**Source:** [extract_expressions_from_format_string.rs](/crates/ide-assists/src/handlers/extract_expressions_from_format_string.rs#14)
+**Source:** [extract_expressions_from_format_string.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_expressions_from_format_string.rs#L14)
Move an expression out of a format string.
@@ -1085,7 +1111,7 @@ fn main() {
### `extract_function`
-**Source:** [extract_function.rs](/crates/ide-assists/src/handlers/extract_function.rs#39)
+**Source:** [extract_function.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_function.rs#L39)
Extracts selected statements and comments into new function.
@@ -1117,7 +1143,7 @@ fn ┃fun_name(n: i32) {
### `extract_module`
-**Source:** [extract_module.rs](/crates/ide-assists/src/handlers/extract_module.rs#29)
+**Source:** [extract_module.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_module.rs#L29)
Extracts a selected region as separate module. All the references, visibility and imports are
resolved.
@@ -1148,7 +1174,7 @@ fn bar(name: i32) -> i32 {
### `extract_static`
-**Source:** [extract_variable.rs](/crates/ide-assists/src/handlers/extract_variable.rs#52)
+**Source:** [extract_variable.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L52)
Extracts subexpression into a static.
@@ -1169,7 +1195,7 @@ fn main() {
### `extract_struct_from_enum_variant`
-**Source:** [extract_struct_from_enum_variant.rs](/crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs#26)
+**Source:** [extract_struct_from_enum_variant.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_struct_from_enum_variant.rs#L26)
Extracts a struct from enum variant.
@@ -1187,7 +1213,7 @@ enum A { One(One) }
### `extract_type_alias`
-**Source:** [extract_type_alias.rs](/crates/ide-assists/src/handlers/extract_type_alias.rs#10)
+**Source:** [extract_type_alias.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_type_alias.rs#L10)
Extracts the selected type as a type alias.
@@ -1209,7 +1235,7 @@ struct S {
### `extract_variable`
-**Source:** [extract_variable.rs](/crates/ide-assists/src/handlers/extract_variable.rs#18)
+**Source:** [extract_variable.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/extract_variable.rs#L18)
Extracts subexpression into a variable.
@@ -1230,7 +1256,7 @@ fn main() {
### `fill_record_pattern_fields`
-**Source:** [fill_record_pattern_fields.rs](/crates/ide-assists/src/handlers/fill_record_pattern_fields.rs#8)
+**Source:** [fill_record_pattern_fields.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/fill_record_pattern_fields.rs#L8)
Fills fields by replacing rest pattern in record patterns.
@@ -1254,7 +1280,7 @@ fn foo(bar: Bar) {
### `fix_visibility`
-**Source:** [fix_visibility.rs](/crates/ide-assists/src/handlers/fix_visibility.rs#14)
+**Source:** [fix_visibility.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/fix_visibility.rs#L14)
Makes inaccessible item public.
@@ -1280,7 +1306,7 @@ fn main() {
### `flip_binexpr`
-**Source:** [flip_binexpr.rs](/crates/ide-assists/src/handlers/flip_binexpr.rs#8)
+**Source:** [flip_binexpr.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/flip_binexpr.rs#L8)
Flips operands of a binary expression.
@@ -1300,7 +1326,7 @@ fn main() {
### `flip_comma`
-**Source:** [flip_comma.rs](/crates/ide-assists/src/handlers/flip_comma.rs#10)
+**Source:** [flip_comma.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/flip_comma.rs#L10)
Flips two comma-separated items.
@@ -1320,7 +1346,7 @@ fn main() {
### `flip_trait_bound`
-**Source:** [flip_trait_bound.rs](/crates/ide-assists/src/handlers/flip_trait_bound.rs#9)
+**Source:** [flip_trait_bound.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/flip_trait_bound.rs#L9)
Flips two trait bounds.
@@ -1336,7 +1362,7 @@ fn foo<T: Copy + Clone>() { }
### `generate_constant`
-**Source:** [generate_constant.rs](/crates/ide-assists/src/handlers/generate_constant.rs#14)
+**Source:** [generate_constant.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_constant.rs#L14)
Generate a named constant.
@@ -1361,7 +1387,7 @@ fn main() {
### `generate_default_from_enum_variant`
-**Source:** [generate_default_from_enum_variant.rs](/crates/ide-assists/src/handlers/generate_default_from_enum_variant.rs#6)
+**Source:** [generate_default_from_enum_variant.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_default_from_enum_variant.rs#L6)
Adds a Default impl for an enum using a variant.
@@ -1391,7 +1417,7 @@ impl Default for Version {
### `generate_default_from_new`
-**Source:** [generate_default_from_new.rs](/crates/ide-assists/src/handlers/generate_default_from_new.rs#13)
+**Source:** [generate_default_from_new.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_default_from_new.rs#L13)
Generates default implementation from new method.
@@ -1425,7 +1451,7 @@ impl Default for Example {
### `generate_delegate_methods`
-**Source:** [generate_delegate_methods.rs](/crates/ide-assists/src/handlers/generate_delegate_methods.rs#15)
+**Source:** [generate_delegate_methods.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_delegate_methods.rs#L15)
Generate delegate methods.
@@ -1465,7 +1491,7 @@ impl Person {
### `generate_delegate_trait`
-**Source:** [generate_delegate_trait.rs](/crates/ide-assists/src/handlers/generate_delegate_trait.rs#29)
+**Source:** [generate_delegate_trait.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_delegate_trait.rs#L29)
Generate delegate trait implementation for `StructField`s.
@@ -1531,7 +1557,7 @@ impl SomeTrait for B {
### `generate_deref`
-**Source:** [generate_deref.rs](/crates/ide-assists/src/handlers/generate_deref.rs#16)
+**Source:** [generate_deref.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_deref.rs#L16)
Generate `Deref` impl using the given struct field.
@@ -1561,7 +1587,7 @@ impl core::ops::Deref for B {
### `generate_derive`
-**Source:** [generate_derive.rs](/crates/ide-assists/src/handlers/generate_derive.rs#8)
+**Source:** [generate_derive.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_derive.rs#L8)
Adds a new `#[derive()]` clause to a struct or enum.
@@ -1584,7 +1610,7 @@ struct Point {
### `generate_doc_example`
-**Source:** [generate_documentation_template.rs](/crates/ide-assists/src/handlers/generate_documentation_template.rs#76)
+**Source:** [generate_documentation_template.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_documentation_template.rs#L76)
Generates a rustdoc example when editing an item's documentation.
@@ -1610,7 +1636,7 @@ pub fn add(a: i32, b: i32) -> i32 { a + b }
### `generate_documentation_template`
-**Source:** [generate_documentation_template.rs](/crates/ide-assists/src/handlers/generate_documentation_template.rs#13)
+**Source:** [generate_documentation_template.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_documentation_template.rs#L13)
Adds a documentation template above a function definition / declaration.
@@ -1645,7 +1671,7 @@ impl S {
### `generate_enum_as_method`
-**Source:** [generate_enum_projection_method.rs](/crates/ide-assists/src/handlers/generate_enum_projection_method.rs#59)
+**Source:** [generate_enum_projection_method.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_enum_projection_method.rs#L59)
Generate an `as_` method for this enum variant.
@@ -1677,7 +1703,7 @@ impl Value {
### `generate_enum_is_method`
-**Source:** [generate_enum_is_method.rs](/crates/ide-assists/src/handlers/generate_enum_is_method.rs#11)
+**Source:** [generate_enum_is_method.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_enum_is_method.rs#L11)
Generate an `is_` method for this enum variant.
@@ -1711,7 +1737,7 @@ impl Version {
### `generate_enum_try_into_method`
-**Source:** [generate_enum_projection_method.rs](/crates/ide-assists/src/handlers/generate_enum_projection_method.rs#12)
+**Source:** [generate_enum_projection_method.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_enum_projection_method.rs#L12)
Generate a `try_into_` method for this enum variant.
@@ -1743,7 +1769,7 @@ impl Value {
### `generate_enum_variant`
-**Source:** [generate_enum_variant.rs](/crates/ide-assists/src/handlers/generate_enum_variant.rs#10)
+**Source:** [generate_enum_variant.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_enum_variant.rs#L10)
Adds a variant to an enum.
@@ -1772,7 +1798,7 @@ fn main() {
### `generate_fn_type_alias_named`
-**Source:** [generate_fn_type_alias.rs](/crates/ide-assists/src/handlers/generate_fn_type_alias.rs#10)
+**Source:** [generate_fn_type_alias.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_fn_type_alias.rs#L10)
Generate a type alias for the function with named parameters.
@@ -1790,7 +1816,7 @@ unsafe fn foo(n: i32) -> i32 { 42i32 }
### `generate_fn_type_alias_unnamed`
-**Source:** [generate_fn_type_alias.rs](/crates/ide-assists/src/handlers/generate_fn_type_alias.rs#24)
+**Source:** [generate_fn_type_alias.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_fn_type_alias.rs#L24)
Generate a type alias for the function with unnamed parameters.
@@ -1808,7 +1834,7 @@ unsafe fn foo(n: i32) -> i32 { 42i32 }
### `generate_from_impl_for_enum`
-**Source:** [generate_from_impl_for_enum.rs](/crates/ide-assists/src/handlers/generate_from_impl_for_enum.rs#8)
+**Source:** [generate_from_impl_for_enum.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_from_impl_for_enum.rs#L8)
Adds a From impl for this enum variant with one tuple field.
@@ -1830,7 +1856,7 @@ impl From<u32> for A {
### `generate_function`
-**Source:** [generate_function.rs](/crates/ide-assists/src/handlers/generate_function.rs#28)
+**Source:** [generate_function.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_function.rs#L28)
Adds a stub function with a signature matching the function under the cursor.
@@ -1860,7 +1886,7 @@ fn bar(arg: &str, baz: Baz) ${0:-> _} {
### `generate_getter`
-**Source:** [generate_getter_or_setter.rs](/crates/ide-assists/src/handlers/generate_getter_or_setter.rs#73)
+**Source:** [generate_getter_or_setter.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_getter_or_setter.rs#L73)
Generate a getter method.
@@ -1886,7 +1912,7 @@ impl Person {
### `generate_getter_mut`
-**Source:** [generate_getter_or_setter.rs](/crates/ide-assists/src/handlers/generate_getter_or_setter.rs#127)
+**Source:** [generate_getter_or_setter.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_getter_or_setter.rs#L127)
Generate a mut getter method.
@@ -1912,7 +1938,7 @@ impl Person {
### `generate_impl`
-**Source:** [generate_impl.rs](/crates/ide-assists/src/handlers/generate_impl.rs#20)
+**Source:** [generate_impl.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L20)
Adds a new inherent impl for a type.
@@ -1934,7 +1960,7 @@ impl<T: Clone> Ctx<T> {┃}
### `generate_is_empty_from_len`
-**Source:** [generate_is_empty_from_len.rs](/crates/ide-assists/src/handlers/generate_is_empty_from_len.rs#12)
+**Source:** [generate_is_empty_from_len.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_is_empty_from_len.rs#L12)
Generates is_empty implementation from the len method.
@@ -1969,7 +1995,7 @@ impl MyStruct {
### `generate_mut_trait_impl`
-**Source:** [generate_mut_trait_impl.rs](/crates/ide-assists/src/handlers/generate_mut_trait_impl.rs#12)
+**Source:** [generate_mut_trait_impl.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_mut_trait_impl.rs#L12)
Adds a IndexMut impl from the `Index` trait.
@@ -2007,7 +2033,7 @@ impl<T> core::ops::Index<Axis> for [T; 3] {
### `generate_new`
-**Source:** [generate_new.rs](/crates/ide-assists/src/handlers/generate_new.rs#14)
+**Source:** [generate_new.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_new.rs#L14)
Adds a `fn new` for a type.
@@ -2033,7 +2059,7 @@ impl<T: Clone> Ctx<T> {
### `generate_setter`
-**Source:** [generate_getter_or_setter.rs](/crates/ide-assists/src/handlers/generate_getter_or_setter.rs#13)
+**Source:** [generate_getter_or_setter.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_getter_or_setter.rs#L13)
Generate a setter method.
@@ -2059,7 +2085,7 @@ impl Person {
### `generate_trait_from_impl`
-**Source:** [generate_trait_from_impl.rs](/crates/ide-assists/src/handlers/generate_trait_from_impl.rs#18)
+**Source:** [generate_trait_from_impl.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_trait_from_impl.rs#L18)
Generate trait for an already defined inherent impl and convert impl to a trait impl.
@@ -2118,7 +2144,7 @@ impl<const N: usize> ${0:NewTrait}<N> for Foo<N> {
### `generate_trait_impl`
-**Source:** [generate_impl.rs](/crates/ide-assists/src/handlers/generate_impl.rs#66)
+**Source:** [generate_impl.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/generate_impl.rs#L66)
Adds a new trait impl for a type.
@@ -2140,7 +2166,7 @@ impl<T: Clone> ${0:_} for Ctx<T> {}
### `inline_call`
-**Source:** [inline_call.rs](/crates/ide-assists/src/handlers/inline_call.rs#170)
+**Source:** [inline_call.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_call.rs#L170)
Inlines a function or method body creating a `let` statement per parameter unless the parameter
can be inlined. The parameter will be inlined either if it the supplied argument is a simple local
@@ -2165,7 +2191,7 @@ fn foo(name: Option<&str>) {
### `inline_const_as_literal`
-**Source:** [inline_const_as_literal.rs](/crates/ide-assists/src/handlers/inline_const_as_literal.rs#6)
+**Source:** [inline_const_as_literal.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_const_as_literal.rs#L6)
Evaluate and inline const variable as literal.
@@ -2189,7 +2215,7 @@ fn something() -> &'static str {
### `inline_into_callers`
-**Source:** [inline_call.rs](/crates/ide-assists/src/handlers/inline_call.rs#32)
+**Source:** [inline_call.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_call.rs#L32)
Inline a function or method body into all of its callers where possible, creating a `let` statement per parameter
unless the parameter can be inlined. The parameter will be inlined either if it the supplied argument is a simple local
@@ -2232,7 +2258,7 @@ fn bar() {
### `inline_local_variable`
-**Source:** [inline_local_variable.rs](/crates/ide-assists/src/handlers/inline_local_variable.rs#17)
+**Source:** [inline_local_variable.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_local_variable.rs#L17)
Inlines a local variable.
@@ -2253,7 +2279,7 @@ fn main() {
### `inline_macro`
-**Source:** [inline_macro.rs](/crates/ide-assists/src/handlers/inline_macro.rs#7)
+**Source:** [inline_macro.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_macro.rs#L7)
Takes a macro and inlines it one step.
@@ -2289,7 +2315,7 @@ fn main() {
### `inline_type_alias`
-**Source:** [inline_type_alias.rs](/crates/ide-assists/src/handlers/inline_type_alias.rs#106)
+**Source:** [inline_type_alias.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_type_alias.rs#L106)
Replace a type alias with its concrete type.
@@ -2313,7 +2339,7 @@ fn main() {
### `inline_type_alias_uses`
-**Source:** [inline_type_alias.rs](/crates/ide-assists/src/handlers/inline_type_alias.rs#24)
+**Source:** [inline_type_alias.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/inline_type_alias.rs#L24)
Inline a type alias into all of its uses where possible.
@@ -2341,7 +2367,7 @@ fn foo() {
### `into_to_qualified_from`
-**Source:** [into_to_qualified_from.rs](/crates/ide-assists/src/handlers/into_to_qualified_from.rs#10)
+**Source:** [into_to_qualified_from.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/into_to_qualified_from.rs#L10)
Convert an `into` method call to a fully qualified `from` call.
@@ -2378,7 +2404,7 @@ fn main() -> () {
### `introduce_named_generic`
-**Source:** [introduce_named_generic.rs](/crates/ide-assists/src/handlers/introduce_named_generic.rs#7)
+**Source:** [introduce_named_generic.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/introduce_named_generic.rs#L7)
Replaces `impl Trait` function argument with the named generic.
@@ -2394,7 +2420,7 @@ fn foo<┃B: Bar>(bar: B) {}
### `introduce_named_lifetime`
-**Source:** [introduce_named_lifetime.rs](/crates/ide-assists/src/handlers/introduce_named_lifetime.rs#13)
+**Source:** [introduce_named_lifetime.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/introduce_named_lifetime.rs#L13)
Change an anonymous lifetime to a named lifetime.
@@ -2422,7 +2448,7 @@ impl<'a> Cursor<'a> {
### `invert_if`
-**Source:** [invert_if.rs](/crates/ide-assists/src/handlers/invert_if.rs#13)
+**Source:** [invert_if.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/invert_if.rs#L13)
This transforms if expressions of the form `if !x {A} else {B}` into `if x {B} else {A}`
This also works with `!=`. This assist can only be applied with the cursor on `if`.
@@ -2443,7 +2469,7 @@ fn main() {
### `line_to_block`
-**Source:** [convert_comment_block.rs](/crates/ide-assists/src/handlers/convert_comment_block.rs#9)
+**Source:** [convert_comment_block.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/convert_comment_block.rs#L9)
Converts comments between block and single-line form.
@@ -2463,7 +2489,7 @@ Converts comments between block and single-line form.
### `make_raw_string`
-**Source:** [raw_string.rs](/crates/ide-assists/src/handlers/raw_string.rs#7)
+**Source:** [raw_string.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/raw_string.rs#L7)
Adds `r#` to a plain string literal.
@@ -2483,7 +2509,7 @@ fn main() {
### `make_usual_string`
-**Source:** [raw_string.rs](/crates/ide-assists/src/handlers/raw_string.rs#47)
+**Source:** [raw_string.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/raw_string.rs#L47)
Turns a raw string into a plain string.
@@ -2503,7 +2529,7 @@ fn main() {
### `merge_imports`
-**Source:** [merge_imports.rs](/crates/ide-assists/src/handlers/merge_imports.rs#21)
+**Source:** [merge_imports.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/merge_imports.rs#L21)
Merges neighbor imports with a common prefix.
@@ -2520,7 +2546,7 @@ use std::{fmt::Formatter, io};
### `merge_match_arms`
-**Source:** [merge_match_arms.rs](/crates/ide-assists/src/handlers/merge_match_arms.rs#12)
+**Source:** [merge_match_arms.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/merge_match_arms.rs#L12)
Merges the current match arm with the following if their bodies are identical.
@@ -2549,7 +2575,7 @@ fn handle(action: Action) {
### `merge_nested_if`
-**Source:** [merge_nested_if.rs](/crates/ide-assists/src/handlers/merge_nested_if.rs#11)
+**Source:** [merge_nested_if.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/merge_nested_if.rs#L11)
This transforms if expressions of the form `if x { if y {A} }` into `if x && y {A}`
This assist can only be applied with the cursor on `if`.
@@ -2570,7 +2596,7 @@ fn main() {
### `move_arm_cond_to_match_guard`
-**Source:** [move_guard.rs](/crates/ide-assists/src/handlers/move_guard.rs#69)
+**Source:** [move_guard.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/move_guard.rs#L69)
Moves if expression from match arm body into a guard.
@@ -2600,7 +2626,7 @@ fn handle(action: Action) {
### `move_bounds_to_where_clause`
-**Source:** [move_bounds.rs](/crates/ide-assists/src/handlers/move_bounds.rs#12)
+**Source:** [move_bounds.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/move_bounds.rs#L12)
Moves inline type bounds to a where clause.
@@ -2620,7 +2646,7 @@ fn apply<T, U, F>(f: F, x: T) -> U where F: FnOnce(T) -> U {
### `move_const_to_impl`
-**Source:** [move_const_to_impl.rs](/crates/ide-assists/src/handlers/move_const_to_impl.rs#14)
+**Source:** [move_const_to_impl.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/move_const_to_impl.rs#L14)
Move a local constant item in a method to impl's associated constant. All the references will be
qualified with `Self::`.
@@ -2653,7 +2679,7 @@ impl S {
### `move_from_mod_rs`
-**Source:** [move_from_mod_rs.rs](/crates/ide-assists/src/handlers/move_from_mod_rs.rs#12)
+**Source:** [move_from_mod_rs.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/move_from_mod_rs.rs#L12)
Moves xxx/mod.rs to xxx.rs.
@@ -2672,7 +2698,7 @@ fn t() {}
### `move_guard_to_arm_body`
-**Source:** [move_guard.rs](/crates/ide-assists/src/handlers/move_guard.rs#8)
+**Source:** [move_guard.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/move_guard.rs#L8)
Moves match guard into match arm body.
@@ -2704,7 +2730,7 @@ fn handle(action: Action) {
### `move_module_to_file`
-**Source:** [move_module_to_file.rs](/crates/ide-assists/src/handlers/move_module_to_file.rs#15)
+**Source:** [move_module_to_file.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/move_module_to_file.rs#L15)
Moves inline module's contents to a separate file.
@@ -2722,7 +2748,7 @@ mod foo;
### `move_to_mod_rs`
-**Source:** [move_to_mod_rs.rs](/crates/ide-assists/src/handlers/move_to_mod_rs.rs#12)
+**Source:** [move_to_mod_rs.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/move_to_mod_rs.rs#L12)
Moves xxx.rs to xxx/mod.rs.
@@ -2741,7 +2767,7 @@ fn t() {}
### `normalize_import`
-**Source:** [normalize_import.rs](/crates/ide-assists/src/handlers/normalize_import.rs#9)
+**Source:** [normalize_import.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/normalize_import.rs#L9)
Normalizes an import.
@@ -2757,7 +2783,7 @@ use std::{fmt::Formatter, io};
### `promote_local_to_const`
-**Source:** [promote_local_to_const.rs](/crates/ide-assists/src/handlers/promote_local_to_const.rs#17)
+**Source:** [promote_local_to_const.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/promote_local_to_const.rs#L17)
Promotes a local variable to a const item changing its name to a `SCREAMING_SNAKE_CASE` variant
if the local uses no non-const expressions.
@@ -2790,7 +2816,7 @@ fn main() {
### `pull_assignment_up`
-**Source:** [pull_assignment_up.rs](/crates/ide-assists/src/handlers/pull_assignment_up.rs#11)
+**Source:** [pull_assignment_up.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/pull_assignment_up.rs#L11)
Extracts variable assignment to outside an if or match statement.
@@ -2822,7 +2848,7 @@ fn main() {
### `qualify_method_call`
-**Source:** [qualify_method_call.rs](/crates/ide-assists/src/handlers/qualify_method_call.rs#10)
+**Source:** [qualify_method_call.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/qualify_method_call.rs#L10)
Replaces the method call with a qualified function call.
@@ -2852,7 +2878,7 @@ fn main() {
### `qualify_path`
-**Source:** [qualify_path.rs](/crates/ide-assists/src/handlers/qualify_path.rs#24)
+**Source:** [qualify_path.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/qualify_path.rs#L24)
If the name is unresolved, provides all possible qualified paths for it.
@@ -2872,7 +2898,7 @@ fn main() {
### `reformat_number_literal`
-**Source:** [number_representation.rs](/crates/ide-assists/src/handlers/number_representation.rs#7)
+**Source:** [number_representation.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/number_representation.rs#L7)
Adds or removes separators from integer literal.
@@ -2888,7 +2914,7 @@ const _: i32 = 1_012_345;
### `remove_dbg`
-**Source:** [remove_dbg.rs](/crates/ide-assists/src/handlers/remove_dbg.rs#9)
+**Source:** [remove_dbg.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/remove_dbg.rs#L9)
Removes `dbg!()` macro call.
@@ -2908,7 +2934,7 @@ fn main() {
### `remove_hash`
-**Source:** [raw_string.rs](/crates/ide-assists/src/handlers/raw_string.rs#117)
+**Source:** [raw_string.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/raw_string.rs#L117)
Removes a hash from a raw string literal.
@@ -2928,7 +2954,7 @@ fn main() {
### `remove_mut`
-**Source:** [remove_mut.rs](/crates/ide-assists/src/handlers/remove_mut.rs#5)
+**Source:** [remove_mut.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/remove_mut.rs#L5)
Removes the `mut` keyword.
@@ -2948,7 +2974,7 @@ impl Walrus {
### `remove_parentheses`
-**Source:** [remove_parentheses.rs](/crates/ide-assists/src/handlers/remove_parentheses.rs#5)
+**Source:** [remove_parentheses.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/remove_parentheses.rs#L5)
Removes redundant parentheses.
@@ -2968,7 +2994,7 @@ fn main() {
### `remove_unused_imports`
-**Source:** [remove_unused_imports.rs](/crates/ide-assists/src/handlers/remove_unused_imports.rs#17)
+**Source:** [remove_unused_imports.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/remove_unused_imports.rs#L17)
Removes any use statements in the current selection that are unused.
@@ -2989,7 +3015,7 @@ mod foo {
### `remove_unused_param`
-**Source:** [remove_unused_param.rs](/crates/ide-assists/src/handlers/remove_unused_param.rs#15)
+**Source:** [remove_unused_param.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/remove_unused_param.rs#L15)
Removes unused function parameter.
@@ -3013,7 +3039,7 @@ fn main() {
### `reorder_fields`
-**Source:** [reorder_fields.rs](/crates/ide-assists/src/handlers/reorder_fields.rs#8)
+**Source:** [reorder_fields.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/reorder_fields.rs#L8)
Reorder the fields of record literals and record patterns in the same order as in
the definition.
@@ -3032,7 +3058,7 @@ const test: Foo = Foo {foo: 1, bar: 0}
### `reorder_impl_items`
-**Source:** [reorder_impl_items.rs](/crates/ide-assists/src/handlers/reorder_impl_items.rs#11)
+**Source:** [reorder_impl_items.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/reorder_impl_items.rs#L11)
Reorder the items of an `impl Trait`. The items will be ordered
in the same order as in the trait definition.
@@ -3071,7 +3097,7 @@ impl Foo for Bar {
### `replace_arith_with_checked`
-**Source:** [replace_arith_op.rs](/crates/ide-assists/src/handlers/replace_arith_op.rs#9)
+**Source:** [replace_arith_op.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_arith_op.rs#L9)
Replaces arithmetic on integers with the `checked_*` equivalent.
@@ -3091,7 +3117,7 @@ fn main() {
### `replace_arith_with_saturating`
-**Source:** [replace_arith_op.rs](/crates/ide-assists/src/handlers/replace_arith_op.rs#28)
+**Source:** [replace_arith_op.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_arith_op.rs#L28)
Replaces arithmetic on integers with the `saturating_*` equivalent.
@@ -3111,7 +3137,7 @@ fn main() {
### `replace_arith_with_wrapping`
-**Source:** [replace_arith_op.rs](/crates/ide-assists/src/handlers/replace_arith_op.rs#50)
+**Source:** [replace_arith_op.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_arith_op.rs#L50)
Replaces arithmetic on integers with the `wrapping_*` equivalent.
@@ -3131,7 +3157,7 @@ fn main() {
### `replace_char_with_string`
-**Source:** [replace_string_with_char.rs](/crates/ide-assists/src/handlers/replace_string_with_char.rs#51)
+**Source:** [replace_string_with_char.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_string_with_char.rs#L51)
Replace a char literal with a string literal.
@@ -3151,7 +3177,7 @@ fn main() {
### `replace_derive_with_manual_impl`
-**Source:** [replace_derive_with_manual_impl.rs](/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs#20)
+**Source:** [replace_derive_with_manual_impl.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_derive_with_manual_impl.rs#L20)
Converts a `derive` impl into a manual one.
@@ -3175,7 +3201,7 @@ impl Debug for S {
### `replace_if_let_with_match`
-**Source:** [replace_if_let_with_match.rs](/crates/ide-assists/src/handlers/replace_if_let_with_match.rs#20)
+**Source:** [replace_if_let_with_match.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_if_let_with_match.rs#L20)
Replaces a `if let` expression with a `match` expression.
@@ -3206,7 +3232,7 @@ fn handle(action: Action) {
### `replace_is_some_with_if_let_some`
-**Source:** [replace_is_method_with_if_let_method.rs](/crates/ide-assists/src/handlers/replace_is_method_with_if_let_method.rs#9)
+**Source:** [replace_is_method_with_if_let_method.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_is_method_with_if_let_method.rs#L9)
Replace `if x.is_some()` with `if let Some(_tmp) = x` or `if x.is_ok()` with `if let Ok(_tmp) = x`.
@@ -3228,7 +3254,7 @@ fn main() {
### `replace_let_with_if_let`
-**Source:** [replace_let_with_if_let.rs](/crates/ide-assists/src/handlers/replace_let_with_if_let.rs#9)
+**Source:** [replace_let_with_if_let.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_let_with_if_let.rs#L9)
Replaces `let` with an `if let`.
@@ -3255,7 +3281,7 @@ fn compute() -> Option<i32> { None }
### `replace_match_with_if_let`
-**Source:** [replace_if_let_with_match.rs](/crates/ide-assists/src/handlers/replace_if_let_with_match.rs#188)
+**Source:** [replace_if_let_with_match.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_if_let_with_match.rs#L188)
Replaces a binary `match` with a wildcard pattern and no guards with an `if let` expression.
@@ -3286,7 +3312,7 @@ fn handle(action: Action) {
### `replace_named_generic_with_impl`
-**Source:** [replace_named_generic_with_impl.rs](/crates/ide-assists/src/handlers/replace_named_generic_with_impl.rs#18)
+**Source:** [replace_named_generic_with_impl.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_named_generic_with_impl.rs#L18)
Replaces named generic with an `impl Trait` in function argument.
@@ -3302,7 +3328,7 @@ fn new(location: impl AsRef<Path>) -> Self {}
### `replace_qualified_name_with_use`
-**Source:** [replace_qualified_name_with_use.rs](/crates/ide-assists/src/handlers/replace_qualified_name_with_use.rs#13)
+**Source:** [replace_qualified_name_with_use.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_qualified_name_with_use.rs#L13)
Adds a use statement for a given fully-qualified name.
@@ -3320,7 +3346,7 @@ fn process(map: HashMap<String, String>) {}
### `replace_string_with_char`
-**Source:** [replace_string_with_char.rs](/crates/ide-assists/src/handlers/replace_string_with_char.rs#11)
+**Source:** [replace_string_with_char.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_string_with_char.rs#L11)
Replace string literal with char literal.
@@ -3340,7 +3366,7 @@ fn main() {
### `replace_try_expr_with_match`
-**Source:** [replace_try_expr_with_match.rs](/crates/ide-assists/src/handlers/replace_try_expr_with_match.rs#18)
+**Source:** [replace_try_expr_with_match.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_try_expr_with_match.rs#L18)
Replaces a `try` expression with a `match` expression.
@@ -3363,7 +3389,7 @@ fn handle() {
### `replace_turbofish_with_explicit_type`
-**Source:** [replace_turbofish_with_explicit_type.rs](/crates/ide-assists/src/handlers/replace_turbofish_with_explicit_type.rs#12)
+**Source:** [replace_turbofish_with_explicit_type.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_turbofish_with_explicit_type.rs#L12)
Converts `::<_>` to an explicit type assignment.
@@ -3385,7 +3411,7 @@ fn main() {
### `replace_with_eager_method`
-**Source:** [replace_method_eager_lazy.rs](/crates/ide-assists/src/handlers/replace_method_eager_lazy.rs#89)
+**Source:** [replace_method_eager_lazy.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_method_eager_lazy.rs#L89)
Replace `unwrap_or_else` with `unwrap_or` and `ok_or_else` with `ok_or`.
@@ -3407,7 +3433,7 @@ fn foo() {
### `replace_with_lazy_method`
-**Source:** [replace_method_eager_lazy.rs](/crates/ide-assists/src/handlers/replace_method_eager_lazy.rs#9)
+**Source:** [replace_method_eager_lazy.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/replace_method_eager_lazy.rs#L9)
Replace `unwrap_or` with `unwrap_or_else` and `ok_or` with `ok_or_else`.
@@ -3429,7 +3455,7 @@ fn foo() {
### `sort_items`
-**Source:** [sort_items.rs](/crates/ide-assists/src/handlers/sort_items.rs#12)
+**Source:** [sort_items.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/sort_items.rs#L12)
Sorts item members alphabetically: fields, enum variants and methods.
@@ -3520,7 +3546,7 @@ enum Animal {
### `split_import`
-**Source:** [split_import.rs](/crates/ide-assists/src/handlers/split_import.rs#5)
+**Source:** [split_import.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/split_import.rs#L5)
Wraps the tail of import into braces.
@@ -3536,7 +3562,7 @@ use std::{collections::HashMap};
### `sugar_impl_future_into_async`
-**Source:** [toggle_async_sugar.rs](/crates/ide-assists/src/handlers/toggle_async_sugar.rs#13)
+**Source:** [toggle_async_sugar.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/toggle_async_sugar.rs#L13)
Rewrites asynchronous function from `-> impl Future` into `async fn`.
This action does not touch the function body and therefore `async { 0 }`
@@ -3558,7 +3584,7 @@ pub async fn foo() -> usize {
### `toggle_ignore`
-**Source:** [toggle_ignore.rs](/crates/ide-assists/src/handlers/toggle_ignore.rs#8)
+**Source:** [toggle_ignore.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/toggle_ignore.rs#L8)
Adds `#[ignore]` attribute to the test.
@@ -3581,7 +3607,7 @@ fn arithmetics {
### `toggle_macro_delimiter`
-**Source:** [toggle_macro_delimiter.rs](/crates/ide-assists/src/handlers/toggle_macro_delimiter.rs#9)
+**Source:** [toggle_macro_delimiter.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/toggle_macro_delimiter.rs#L9)
Change macro delimiters in the order of `( -> { -> [ -> (`.
@@ -3605,7 +3631,7 @@ sth!{ }
### `unmerge_match_arm`
-**Source:** [unmerge_match_arm.rs](/crates/ide-assists/src/handlers/unmerge_match_arm.rs#10)
+**Source:** [unmerge_match_arm.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/unmerge_match_arm.rs#L10)
Splits the current match with a `|` pattern into two arms with identical bodies.
@@ -3634,7 +3660,7 @@ fn handle(action: Action) {
### `unmerge_use`
-**Source:** [unmerge_use.rs](/crates/ide-assists/src/handlers/unmerge_use.rs#12)
+**Source:** [unmerge_use.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/unmerge_use.rs#L12)
Extracts single use item from use list.
@@ -3651,7 +3677,7 @@ use std::fmt::Display;
### `unnecessary_async`
-**Source:** [unnecessary_async.rs](/crates/ide-assists/src/handlers/unnecessary_async.rs#17)
+**Source:** [unnecessary_async.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/unnecessary_async.rs#L17)
Removes the `async` mark from functions which have no `.await` in their body.
Looks for calls to the functions and removes the `.await` on the call site.
@@ -3670,7 +3696,7 @@ pub async fn bar() { foo() }
### `unqualify_method_call`
-**Source:** [unqualify_method_call.rs](/crates/ide-assists/src/handlers/unqualify_method_call.rs#9)
+**Source:** [unqualify_method_call.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/unqualify_method_call.rs#L9)
Transforms universal function call syntax into a method call.
@@ -3692,7 +3718,7 @@ fn main() {
### `unwrap_block`
-**Source:** [unwrap_block.rs](/crates/ide-assists/src/handlers/unwrap_block.rs#12)
+**Source:** [unwrap_block.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/unwrap_block.rs#L12)
This assist removes if...else, for, while and loop control statements to just keep the body.
@@ -3714,7 +3740,7 @@ fn foo() {
### `unwrap_option_return_type`
-**Source:** [unwrap_return_type.rs](/crates/ide-assists/src/handlers/unwrap_return_type.rs#13)
+**Source:** [unwrap_return_type.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/unwrap_return_type.rs#L13)
Unwrap the function's return type.
@@ -3730,7 +3756,7 @@ fn foo() -> i32 { 42i32 }
### `unwrap_result_return_type`
-**Source:** [unwrap_return_type.rs](/crates/ide-assists/src/handlers/unwrap_return_type.rs#26)
+**Source:** [unwrap_return_type.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/unwrap_return_type.rs#L26)
Unwrap the function's return type.
@@ -3746,7 +3772,7 @@ fn foo() -> i32 { 42i32 }
### `unwrap_tuple`
-**Source:** [unwrap_tuple.rs](/crates/ide-assists/src/handlers/unwrap_tuple.rs#8)
+**Source:** [unwrap_tuple.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/unwrap_tuple.rs#L8)
Unwrap the tuple to different variables.
@@ -3767,7 +3793,7 @@ fn main() {
### `wrap_return_type_in_option`
-**Source:** [wrap_return_type.rs](/crates/ide-assists/src/handlers/wrap_return_type.rs#16)
+**Source:** [wrap_return_type.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/wrap_return_type.rs#L16)
Wrap the function's return type into Option.
@@ -3783,7 +3809,7 @@ fn foo() -> Option<i32> { Some(42i32) }
### `wrap_return_type_in_result`
-**Source:** [wrap_return_type.rs](/crates/ide-assists/src/handlers/wrap_return_type.rs#29)
+**Source:** [wrap_return_type.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/wrap_return_type.rs#L29)
Wrap the function's return type into Result.
@@ -3799,7 +3825,7 @@ fn foo() -> Result<i32, ${0:_}> { Ok(42i32) }
### `wrap_unwrap_cfg_attr`
-**Source:** [wrap_unwrap_cfg_attr.rs](/crates/ide-assists/src/handlers/wrap_unwrap_cfg_attr.rs#12)
+**Source:** [wrap_unwrap_cfg_attr.rs](https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-assists/src/handlers/wrap_unwrap_cfg_attr.rs#L12)
Wraps an attribute to a cfg_attr attribute or unwraps a cfg_attr attribute to the inner attributes.