rust-analyzer/crates/ide-assists/src/handlers
bors 65a644190d Auto merge of #16424 - dfireBird:let-stmt-guarded-return-assist, r=Veykril
implement convert to guarded return assist for `let` statement with type that implements `std::ops::Try`

I've tried to implement the assist that #16390 talked about

If there are any improvements that I can make in implementation, please suggest them.

![Peek 2024-02-05 19-01](https://github.com/rust-lang/rust-analyzer/assets/40687700/d6af3222-4f23-4ade-a930-8a78cc75e821)
2024-02-09 13:42:20 +00:00
..
add_braces.rs fixes 2023-01-21 23:42:11 +05:30
add_explicit_type.rs Add flag to disallow opaque types for DisplayTarget::SourceCode 2023-04-12 19:03:48 +09:00
add_label_to_loop.rs Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
add_lifetime_to_type.rs Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
add_missing_impl_members.rs Auto merge of #16448 - Young-Flash:typos, r=lnicola 2024-01-31 13:29:55 +00:00
add_missing_match_arms.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
add_return_type.rs fix some typos 2023-05-01 14:53:25 +08:00
add_turbo_fish.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
apply_demorgan.rs Replace unwrap with expect 2023-10-04 13:06:23 +02:00
auto_import.rs redundant_pattern_matching 2024-01-19 17:31:01 +01:00
bind_unused_param.rs Better trait implementation support 2023-08-29 22:56:31 +07:00
bool_to_enum.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
change_visibility.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
convert_bool_then.rs Parse builtin# syntax 2023-09-05 10:36:35 +02:00
convert_comment_block.rs v4 2023-09-22 13:32:20 +02:00
convert_integer_literal.rs feat: Hover for literals showing additional value information 2024-01-16 14:28:47 +01:00
convert_into_to_from.rs Add config for preferring / ignoring prelude modules in find_path 2023-11-11 14:56:38 +01:00
convert_iter_for_each_to_for.rs internal: Replace Display impl for Name 2023-05-24 20:55:12 +02:00
convert_let_else_to_match.rs Add inlay hint for exclusive ranges 2024-01-07 09:33:56 +00:00
convert_match_to_let_else.rs question_mark 2024-01-19 17:31:01 +01:00
convert_named_struct_to_tuple_struct.rs Deunwrap convert_named_struct_to_tuple_struct 2023-08-09 16:40:23 +02:00
convert_nested_function_to_closure.rs autofix remaining perf findings 2024-01-07 01:20:20 +01:00
convert_to_guarded_return.rs restrict cursor range to show assists 2024-02-05 18:53:40 +05:30
convert_tuple_return_type_to_struct.rs remove redundant clones 2024-01-07 00:17:48 +01:00
convert_tuple_struct_to_named_struct.rs fix: Fix incorrectly replacing references in macro invocation in "Convert to named struct" assist 2023-11-14 16:01:59 +09:00
convert_two_arm_bool_match_to_matches_macro.rs Allow match to matches assist to trigger on non-literal bool arms 2023-08-01 12:10:38 +02:00
convert_while_to_loop.rs Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
destructure_tuple_binding.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
desugar_doc_comment.rs Lint debug prints and disallowed types with clippy 2024-02-01 17:57:27 +01:00
expand_glob_import.rs Updated search to expose some more functions and to make search take the search scope by reference. 2023-07-09 17:30:21 -04:00
extract_expressions_from_format_string.rs Implicit format args support 2023-12-05 17:07:00 +01:00
extract_function.rs Fix clippy lints 2024-02-08 19:39:04 -05:00
extract_module.rs Lint debug prints and disallowed types with clippy 2024-02-01 17:57:27 +01:00
extract_struct_from_enum_variant.rs minor: use reference.range to get original range 2024-01-20 14:43:42 +08:00
extract_type_alias.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
extract_variable.rs minor: correct typos 2024-01-30 21:43:43 +08:00
fix_visibility.rs Replace ID based TokenMap with proper relative text-ranges / spans 2023-11-28 10:55:39 +01:00
flip_binexpr.rs flip binexpr works for lhs cmp 2023-12-08 11:36:30 +01:00
flip_comma.rs Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
flip_trait_bound.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
generate_constant.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
generate_default_from_enum_variant.rs Migrate assists to format args captures, part 2 2022-10-12 02:23:35 -04:00
generate_default_from_new.rs minor: correct some typos 2024-02-02 18:22:54 +08:00
generate_delegate_methods.rs Use GenericArgList for make::impl{_trait} 2024-02-08 19:09:32 -05:00
generate_delegate_trait.rs Add newline to body when where clause is present 2024-02-08 19:13:09 -05:00
generate_deref.rs Add config for preferring / ignoring prelude modules in find_path 2023-11-11 14:56:38 +01:00
generate_derive.rs v2 2023-08-16 00:22:08 +02:00
generate_documentation_template.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
generate_enum_is_method.rs fix: rename generator to coroutine 2024-01-15 12:24:47 +01:00
generate_enum_projection_method.rs Inline all format arguments where possible 2022-12-24 14:36:10 -05:00
generate_enum_variant.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
generate_from_impl_for_enum.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
generate_function.rs internal: fix crash inside filter_unnecessary_bounds for a missing generic param 2024-02-08 20:58:48 -05:00
generate_getter_or_setter.rs Fix clippy lints 2024-02-08 19:39:04 -05:00
generate_impl.rs Migrate generate_impl to mutable ast 2024-02-08 19:13:10 -05:00
generate_is_empty_from_len.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
generate_mut_trait_impl.rs minor: correct typos 2024-01-30 21:43:43 +08:00
generate_new.rs Migrate generate_new to mutable ast 2024-02-08 19:13:10 -05:00
generate_trait_from_impl.rs minor: correct typos 2024-01-30 21:43:43 +08:00
inline_call.rs single_match 2024-01-19 18:31:15 +01:00
inline_const_as_literal.rs nonminimal_bool 2024-01-19 17:31:01 +01:00
inline_local_variable.rs Implicit format args support 2023-12-05 17:07:00 +01:00
inline_macro.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
inline_type_alias.rs Lint debug prints and disallowed types with clippy 2024-02-01 17:57:27 +01:00
into_to_qualified_from.rs minor: correct some typos 2024-02-02 18:22:54 +08:00
introduce_named_generic.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
introduce_named_lifetime.rs Spelling 2023-04-19 09:45:55 -04:00
invert_if.rs Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
merge_imports.rs merge imports assist avoids adding unnecessary braces when merging nested use tree selections 2024-01-28 11:55:01 +03:00
merge_match_arms.rs Lint debug prints and disallowed types with clippy 2024-02-01 17:57:27 +01:00
merge_nested_if.rs use tail_expr(). 2024-01-03 09:48:49 +08:00
move_bounds.rs Fmt 2022-09-02 21:18:36 +00:00
move_const_to_impl.rs Updated search to expose some more functions and to make search take the search scope by reference. 2023-07-09 17:30:21 -04:00
move_from_mod_rs.rs internal: Replace Display impl for Name 2023-05-24 20:55:12 +02:00
move_guard.rs Migrate assists to format args captures, part 3 2022-10-12 02:28:41 -04:00
move_module_to_file.rs internal: Replace Display impl for Name 2023-05-24 20:55:12 +02:00
move_to_mod_rs.rs internal: Replace Display impl for Name 2023-05-24 20:55:12 +02:00
normalize_import.rs add more tests for normalize import assist 2024-01-28 11:55:01 +03:00
number_representation.rs Migrate assists to format args captures, part 3 2022-10-12 02:28:41 -04:00
promote_local_to_const.rs fix: use original range to deal with macros in promote_local_to_const 2024-01-02 10:33:48 +01:00
pull_assignment_up.rs Use anonymous lifetime where possible 2023-06-29 23:27:28 +09:00
qualify_method_call.rs Add config for preferring / ignoring prelude modules in find_path 2023-11-11 14:56:38 +01:00
qualify_path.rs internal: Speed up import searching some more 2024-01-05 12:58:20 +01:00
raw_string.rs update assist to include more literals 2023-06-06 00:34:00 +02:00
remove_dbg.rs Parse builtin# syntax 2023-09-05 10:36:35 +02:00
remove_mut.rs Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
remove_parentheses.rs autofix remaining perf findings 2024-01-07 01:20:20 +01:00
remove_unused_imports.rs Lint debug prints and disallowed types with clippy 2024-02-01 17:57:27 +01:00
remove_unused_param.rs Rollback changes in remove_unused_param.rs 2023-08-29 23:06:12 +07:00
reorder_fields.rs internal: Replace Display impl for Name 2023-05-24 20:55:12 +02:00
reorder_impl_items.rs internal: Replace Display impl for Name 2023-05-24 20:55:12 +02:00
replace_arith_op.rs Fix replace_arith label 2023-01-17 16:31:34 +02:00
replace_derive_with_manual_impl.rs Fix clippy lints 2024-02-08 19:39:04 -05:00
replace_if_let_with_match.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
replace_is_method_with_if_let_method.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
replace_let_with_if_let.rs Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
replace_method_eager_lazy.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
replace_named_generic_with_impl.rs Implicit format args support 2023-12-05 17:07:00 +01:00
replace_qualified_name_with_use.rs order merged use trees 2024-01-12 17:05:23 +03:00
replace_string_with_char.rs Spelling 2023-04-19 09:45:55 -04:00
replace_try_expr_with_match.rs desugar ? operator 2023-03-17 13:08:35 +03:30
replace_turbofish_with_explicit_type.rs redundant_pattern_matching 2024-01-19 17:31:01 +01:00
sort_items.rs Remove unused codes 2024-01-21 12:56:23 +08:00
split_import.rs Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
toggle_ignore.rs Replace option.map(cond) == Some(true) with option.is_some_and(cond) 2023-11-24 09:06:44 -08:00
unmerge_match_arm.rs a number of code simplifications 2023-01-10 18:48:51 +00:00
unmerge_use.rs Give unmerge_use a label explaining what it will affect. 2023-09-16 13:29:03 -07:00
unnecessary_async.rs redundant_pattern_matching 2024-01-19 17:31:01 +01:00
unqualify_method_call.rs chore: add use case for PathSegment::qualifying_trait 2023-11-17 21:31:33 +08:00
unwrap_block.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
unwrap_result_return_type.rs Lint debug prints and disallowed types with clippy 2024-02-01 17:57:27 +01:00
unwrap_tuple.rs Migrate assists to format args captures, part 3 2022-10-12 02:28:41 -04:00
wrap_return_type_in_result.rs fix panic with wrapping/unwrapping result return type assists 2023-09-24 16:00:55 -07:00