From a3dd6be7624247174961e8dfe2e3dcb9ce763d70 Mon Sep 17 00:00:00 2001 From: A4-Tacks Date: Fri, 12 Dec 2025 18:55:49 +0800 Subject: [PATCH] Reorder add_return_type assist This assist is often before inline and is very inconvenient Usually, incomplete expression statements are written at the tail of the block, but they are not the return value of the block ```rust fn foo() { Some(2).$0and(optb) } ``` ```text 1. Add this function's return type 2. Inline `and` 3. Qualify `and` method call 4. Replace and with and_then ``` --- src/tools/rust-analyzer/crates/ide-assists/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rust-analyzer/crates/ide-assists/src/lib.rs b/src/tools/rust-analyzer/crates/ide-assists/src/lib.rs index 16b5684c16a4..47cb4c8e74cb 100644 --- a/src/tools/rust-analyzer/crates/ide-assists/src/lib.rs +++ b/src/tools/rust-analyzer/crates/ide-assists/src/lib.rs @@ -247,7 +247,6 @@ mod handlers { add_label_to_loop::add_label_to_loop, add_lifetime_to_type::add_lifetime_to_type, add_missing_match_arms::add_missing_match_arms, - add_return_type::add_return_type, add_turbo_fish::add_turbo_fish, apply_demorgan::apply_demorgan_iterator, apply_demorgan::apply_demorgan, @@ -392,6 +391,7 @@ mod handlers { // used as a tie-breaker. add_missing_impl_members::add_missing_impl_members, add_missing_impl_members::add_missing_default_members, + add_return_type::add_return_type, // replace_string_with_char::replace_string_with_char, replace_string_with_char::replace_char_with_string,