rust-analyzer/crates/ide-assists/src/handlers
bors 546da8a5ad Auto merge of #18294 - Giga-Bowser:master, r=Veykril
Add wrap/unwrap return type in Option

I pretty much just copied over the code and tests for wrapping/unwrapping return types in `Result` and then did a bunch of find and replace changes.

I handled unwrapping statements returning `None` by just replacing `None` with the unit type, but I'm open to suggestions for more intuitive behavior here.
2024-10-21 13:56:01 +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 Properly account for editions in names 2024-08-16 16:46:24 +03:00
add_missing_match_arms.rs feat: generate names for tuple-struct in add-missing-match-arms 2024-09-10 00:30:48 +08:00
add_return_type.rs fix some typos 2023-05-01 14:53:25 +08:00
add_turbo_fish.rs Rename rust-analyzer commands 2024-07-20 01:11:14 -07:00
apply_demorgan.rs tests: update test in assist apply_demorgan 2024-05-05 23:44:52 +08:00
auto_import.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
bind_unused_param.rs feat: Load sysroot library via cargo metadata 2024-08-05 12:18:19 +02:00
bool_to_enum.rs Update ide tests 2024-10-21 11:28:19 +02:00
change_visibility.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
convert_bool_then.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
convert_closure_to_fn.rs Create an assist to convert closure to freestanding fn 2024-08-27 17:07:55 +03:00
convert_comment_block.rs ide-assists: Fix warnings about clippy str_to_string rule 2024-02-10 01:00:40 +09:00
convert_comment_from_or_to_doc.rs flip the naming of the doc comment to comment assist 2024-07-28 00:48:08 +02:00
convert_from_to_tryfrom.rs HasGenericArgs syntax trait 2024-07-07 11:18:28 +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 Properly account for editions in names 2024-08-16 16:46:24 +03:00
convert_iter_for_each_to_for.rs Properly account for editions in names 2024-08-16 16:46:24 +03: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 Consider field attributes when converting from tuple to named struct and the opposite 2024-08-29 01:14:25 +03: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 Properly account for editions in names 2024-08-16 16:46:24 +03:00
convert_tuple_struct_to_named_struct.rs Consider field attributes when converting from tuple to named struct and the opposite 2024-08-29 01:14:25 +03: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 fix: keep comments in convert_while_to_loop 2024-08-19 17:27:54 +08:00
destructure_struct_binding.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
destructure_tuple_binding.rs Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02: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 Properly account for editions in names 2024-08-16 16:46:24 +03:00
explicit_enum_discriminant.rs Update generated doctests 2024-08-31 10:17:37 +01:00
extract_expressions_from_format_string.rs Remove DescendPreference::SameText 2024-08-22 12:34:20 +02:00
extract_function.rs Auto merge of #17963 - avrong:avrong/error-lifetimes, r=Veykril 2024-08-26 10:06:21 +00:00
extract_module.rs Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
extract_struct_from_enum_variant.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
extract_type_alias.rs Use SyntaxEditor in extract_type_alias 2024-09-17 18:25:32 -04:00
extract_variable.rs minor: Use SyntaxEditor in extract_variable 2024-09-26 16:29:16 -04:00
fill_record_pattern_fields.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
fix_visibility.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
flip_binexpr.rs flip binexpr works for lhs cmp 2023-12-08 11:36:30 +01:00
flip_comma.rs Handle attributes correctly in "Flip comma" 2024-09-01 02:07:05 +03:00
flip_trait_bound.rs test that flip_trait_bound works with trait objects 2024-02-10 11:06:07 +01:00
generate_constant.rs Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02: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 Add gen modifier to functions 2024-08-24 23:46:32 +03:00
generate_delegate_trait.rs Auto merge of #18073 - alibektas:immutable_tree_panics, r=lnicola 2024-09-13 09:44:28 +00:00
generate_deref.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
generate_derive.rs v2 2023-08-16 00:22:08 +02:00
generate_documentation_template.rs Properly account for editions in names 2024-08-16 16:46:24 +03: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 Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
generate_from_impl_for_enum.rs cargo clippy --fix 2024-01-18 13:59:49 +01:00
generate_function.rs Add gen modifier to functions 2024-08-24 23:46:32 +03:00
generate_getter_or_setter.rs Add gen modifier to functions 2024-08-24 23:46:32 +03:00
generate_impl.rs fix: consider indentation in the "Generate impl" and "Generate trait impl" assists 2024-08-29 22:12:25 +02:00
generate_is_empty_from_len.rs Use statics + clone instead of const until const can access statics 2024-07-14 17:52:59 +02:00
generate_mut_trait_impl.rs style: simplify string interpolation 2024-05-30 16:18:49 -07:00
generate_new.rs Add gen modifier to functions 2024-08-24 23:46:32 +03:00
generate_trait_from_impl.rs Migrate generate_trait_from_impl to mutable ast 2024-02-15 21:34:29 -05:00
inline_call.rs Get rid of $crate in expansions shown to the user 2024-09-18 18:30:59 +03:00
inline_const_as_literal.rs fix: Fix inline_const_as_literal error when the number >= 10 2024-09-05 14:26:21 +08:00
inline_local_variable.rs feat: Implement cast typechecks 2024-09-03 04:11:36 +09:00
inline_macro.rs Get rid of $crate in expansions shown to the user 2024-09-18 18:30:59 +03:00
inline_type_alias.rs Remove unnecessary symbols and add missing symbols 2024-09-09 16:36:37 +08:00
into_to_qualified_from.rs style: simplify string interpolation 2024-05-30 16:18:49 -07:00
introduce_named_generic.rs refactor: introduce NameGenerator in suggest_name 2024-09-10 00:30:46 +08:00
introduce_named_lifetime.rs ide-assists: Fix warnings about clippy str_to_string rule 2024-02-10 01:00:40 +09:00
invert_if.rs Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
merge_imports.rs fix: handle synonymous imports in 'merge imports' 2024-07-18 05:01:58 +08: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 style: simplify string interpolation 2024-05-30 16:18:49 -07:00
move_bounds.rs Fmt 2022-09-02 21:18:36 +00:00
move_const_to_impl.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
move_from_mod_rs.rs Properly account for editions in names 2024-08-16 16:46:24 +03: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 Properly account for editions in names 2024-08-16 16:46:24 +03:00
move_to_mod_rs.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
normalize_import.rs do not normalize use foo::{self} to use foo 2024-06-26 08:58:13 +01:00
number_representation.rs ide-assists: Fix warnings about clippy str_to_string rule 2024-02-10 01:00:40 +09:00
promote_local_to_const.rs fix: Fix impl Trait<Self> causing stackoverflows 2024-04-15 15:41:20 +02:00
pull_assignment_up.rs Use anonymous lifetime where possible 2023-06-29 23:27:28 +09:00
qualify_method_call.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
qualify_path.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
raw_string.rs Render literal escaping errors in hovers 2024-05-13 12:51:57 +02:00
remove_dbg.rs Modify hacks::parse_expr_from_str() to take an edition too 2024-08-24 23:46:32 +03:00
remove_mut.rs Run cargo fix --edition-idioms 2022-07-20 15:02:08 +02:00
remove_parentheses.rs fix: don't remove parentheses for calls of function-like pointers that are members of a struct or union 2024-06-21 17:57:53 +03:00
remove_unused_imports.rs fix: Temporary fix for remove_unused_imports not handling import aliases correctly 2024-09-24 23:48:04 +09:00
remove_unused_param.rs Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
reorder_fields.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
reorder_impl_items.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
replace_arith_op.rs Fix replace_arith label 2023-01-17 16:31:34 +02:00
replace_derive_with_manual_impl.rs Properly account for editions in names 2024-08-16 16:46:24 +03: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 refactor: move ide_assist::utils::suggest_name to ide-db 2024-09-03 05:21:05 +08: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 Use Symbol in Name 2024-07-12 16:06:44 +02:00
replace_named_generic_with_impl.rs Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
replace_qualified_name_with_use.rs assist: ensure replace_qualified_name_with_use applies to the first path segment 2024-09-04 12:15:28 -04:00
replace_string_with_char.rs Render literal escaping errors in hovers 2024-05-13 12:51:57 +02:00
replace_try_expr_with_match.rs desugar ? operator 2023-03-17 13:08:35 +03:30
replace_turbofish_with_explicit_type.rs HasGenericArgs syntax trait 2024-07-07 11:18:28 +02: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
term_search.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
toggle_async_sugar.rs Properly account for editions in names 2024-08-16 16:46:24 +03:00
toggle_ignore.rs Consider exported_name="main" functions in test modules as tests 2024-04-04 14:51:10 +02:00
toggle_macro_delimiter.rs Merge some strings 2024-09-02 20:05:35 +03: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 Encode edition within FileId in the hir layer 2024-07-18 08:49:10 +02:00
unqualify_method_call.rs chore: add use case for PathSegment::qualifying_trait 2023-11-17 21:31:33 +08:00
unwrap_block.rs Fix "Unwrap block" assist with block modifiers 2024-08-26 19:02:36 +03:00
unwrap_return_type.rs Combine entry points for wrapping/unwrapping return types 2024-10-19 11:59:52 -04:00
unwrap_tuple.rs Migrate assists to format args captures, part 3 2022-10-12 02:28:41 -04:00
wrap_return_type.rs Combine entry points for wrapping/unwrapping return types 2024-10-19 11:59:52 -04:00
wrap_unwrap_cfg_attr.rs Remove unnecessary symbols and add missing symbols 2024-09-09 16:36:37 +08:00