about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates/ide-assists
AgeCommit message (Collapse)AuthorLines
2025-08-23Merge pull request #20511 from A4-Tacks/fix-conv-int-lit-on-selectedChayim Refael Friedman-2/+8
convert_integer_literal not on selected
2025-08-22fix: convert_integer_literal not on selectedA4-Tacks-2/+8
`convert_integer_literal` can only convert the first literal, it is not reasonable to apply it when selected Example --- ```rust fn main() { $01+1$0; } ``` **Assist old outputs**: ``` Convert 1 to 0b1 Convert 1 to 0o1 Convert 1 to 0x1 Replace arithmetic with call to checked_* Replace arithmetic with call to saturating_* Replace arithmetic with call to wrapping_* Extract into variable Extract into constant Extract into static Extract into function ``` **Assist this PR outputs**: ``` Replace arithmetic with call to checked_* Replace arithmetic with call to saturating_* Replace arithmetic with call to wrapping_* Extract into variable Extract into constant Extract into static Extract into function ```
2025-08-22Fix indent for move_guard_to_arm_bodyA4-Tacks-13/+57
Input: ```rust fn main() { match 92 { x $0if true && true && true => { { false } }, _ => true } } ``` Old output: ```rust fn main() { match 92 { x => if true && true && true { { { false } } }, _ => true }; } ``` This PR fixed: ```rust fn main() { match 92 { x => if true && true && true { { { false } } }, _ => true } } ```
2025-08-19user facing code should use not use `PostAnalysis`lcnr-2/+2
2025-08-18Auto-attach database in `Analysis` callsLukas Wirth-8/+18
2025-08-18Merge pull request #20442 from ChayimFriedman2/unqualifyShoyu Vanilla (Flint)-1/+117
fix: Only import the item in "Unqualify method call" if needed
2025-08-14Merge pull request #20455 from A4-Tacks/fix-indent-conv-match-to-let-elseShoyu Vanilla (Flint)-6/+58
Fix indent for convert_match_to_let_else
2025-08-14Merge pull request #20456 from A4-Tacks/match-with-if-let-guardShoyu Vanilla (Flint)-12/+52
Add guard to let-chain for replace_match_with_if_let
2025-08-14Add guard to let-chain for replace_match_with_if_letA4-Tacks-12/+52
```rust fn main() { match$0 Some(0) { Some(n) if n % 2 == 0 && n != 6 => (), _ => code(), } } ``` -> ```rust fn main() { if let Some(n) = Some(0) && n % 2 == 0 && n != 6 { () } else { code() } }
2025-08-14Fix indent for convert_match_to_let_elseA4-Tacks-6/+58
Example --- ``` //- minicore: option fn f() { let x$0 = match Some(()) { Some(it) => it, None => {//comment println!("nope"); return }, }; } ``` **Old output**: ```rust fn f() { let Some(x) = Some(()) else {//comment println!("nope"); return }; } ``` **This PR output**: ```rust fn f() { let Some(x) = Some(()) else {//comment println!("nope"); return }; } ```
2025-08-13Merge Trait and TraitAlias handlingDeadbeef-6/+0
2025-08-13Merge pull request #20329 from jackh726/next-trait-solver-querifyLukas Wirth-17/+42
Switch from Chalk to the next trait solver
2025-08-13Only import the item in "Unqualify method call" if neededChayim Refael Friedman-1/+117
2025-08-12fix: Implement default member to resolve IdentPatsgasho-0/+49
2025-08-12Make import sorting order follow 2024 edition styleShoyu Vanilla-12/+12
2025-08-10Fix extract_expressions_from_format_string on write!A4-Tacks-6/+40
**Input**: ```rust fn main() { write!(f, "{2+3}$0") } ``` **Old output**: ```rust fn main() { write!("{}"$0, 2+3) } ``` **This PR output**: ```rust fn main() { write!(f, "{}"$0, 2+3) } ```
2025-08-09Implement next trait solverjackh726-17/+42
2025-08-09fix: generate function by indet tokenHmikihiro-1/+29
2025-08-07In extract_module.rs, generate ast::Module instead of StringHmikihiro-66/+109
2025-08-06Merge pull request #20354 from A4-Tacks/clean-lit-stmt-remove-dbgChayim Refael Friedman-0/+50
Add remove literal dbg stmt for remove_dbg
2025-08-06Add remove simple dbg stmt for remove_dbgA4-Tacks-0/+50
Remove only contain literals dbg statement ```rust fn foo() { let n = 2; $0dbg!(3); dbg!(2.6); dbg!(1, 2.5); dbg!('x'); dbg!(&n); dbg!(n); // needless comment dbg!("foo");$0 } ``` -> ```rust fn foo() { // needless comment } ``` Old: ```rust fn foo() { 3; 2.6; (1, 2.5); 'x'; &n; n; // needless comment "foo"; } ```
2025-08-05Merge pull request #20385 from Hmikihiro/migrate_expand_glob_importShoyu Vanilla (Flint)-5/+4
Migrate `expand_glob_import` assist to use `SyntaxEditor`
2025-08-05Merge pull request #20383 from ↵Shoyu Vanilla (Flint)-17/+19
Hmikihiro/remove_ted_from_replace_named_generic_with_impl remove `ted` from replace_named_generic_with_impl.rs
2025-08-05Migrate `expand_glob_import` assist to use `SyntaxEditor`Hmikihiro-5/+4
2025-08-05remove `ted` from replace_named_generic_with_impl.rsHmikihiro-17/+19
2025-08-04remvoe add_attr edit_in_place.rs because it use ted.Hmikihiro-80/+131
2025-08-03Merge pull request #20371 from Hmikihiro/migrate_generate_trait_from_implLukas Wirth-34/+35
Migrate `generate_trait_from_impl` assist to use `SyntaxEditor`
2025-08-03Migrate `generate_trait_from_impl` assist to use `SyntaxEditor`Hmikihiro-34/+35
2025-08-03Merge pull request #20368 from Hmikihiro/migrate_delegate_methodsLukas Wirth-33/+40
Migrate `generate_delegate_methods` assist to use `SyntaxEditor`
2025-08-03Migrate `generate_delegate_methods` assist to use `SyntaxEditor`Hmikihiro-33/+40
2025-08-02Migrate `convert_from_to_tryfrom` assist to use `SyntaxEditor`Hmikihiro-19/+23
2025-07-31Merge pull request #20345 from Hmikihiro/Migrate_add_trait_assoc_items_to_implShoyu Vanilla (Flint)-26/+31
add `SyntaxEditor::delete_all` to migrate utils.rs `add_trait_assoc_items_to_impl`
2025-07-31`cargo clippy --fix`Lukas Wirth-454/+434
2025-07-30add `SyntaxEditor::delete_all` to migrate utils.rs ↵Hmikihiro-26/+31
`add_trait_assoc_items_to_impl`
2025-07-30Merge pull request #20314 from ↵Shoyu Vanilla (Flint)-41/+54
Hmikihiro/Migrate_inline_type_alias_to_syntax_editor Migrate `inline_type_alias` assist to use `syntax_editor`
2025-07-30Merge pull request #20311 from ↵Shoyu Vanilla (Flint)-67/+100
Hmikihiro/migrate_convert_tuple_struct_to_named_struct Migrate `convert_tuple_struct_to_named_struct` assist to use `SyntaxEditor`
2025-07-29replace `make::` to `SyntaxFactory::` in `inline_type_alias`Hmikihiro-11/+16
2025-07-29add `SyntaxFactory::record_expr` to hide clone_for_updateHmikihiro-8/+12
2025-07-29Merge pull request #20336 from ChayimFriedman2/mut-trait-impl-snippetLukas Wirth-2/+49
fix: In generate_mut_trait_impl, don't add a tabstop if the client does not support snippets
2025-07-29In generate_mut_trait_impl, don't add a tabstop if the client does not ↵Chayim Refael Friedman-2/+49
support snippets
2025-07-29Merge pull request #20300 from A4-Tacks/fix-debug_assert-doc-genChayim Refael Friedman-6/+62
Fix gen panics doc template for debug_assert
2025-07-28Merge pull request #20303 from Hmikihiro/migrate_path_transformShoyu Vanilla (Flint)-49/+85
Migrate path transform
2025-07-27Merge pull request #20305 from Hmikihiro/Migrate_part_of_utilsShoyu Vanilla (Flint)-3/+5
Migrate part of utils.rs to use SyntaxEditor
2025-07-27Migrate `convert_tuple_struct_to_named_struct' assist to use `SyntaxEditor'Hayashi Mikihiro-35/+68
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-27migrate `fn edit_struct_def` in `convert_tuple_struct_to_named_struct` to ↵Hayashi Mikihiro-30/+24
SyntaxEditor Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-27remove ted from convert_tuple_struct_to_named_structHayashi Mikihiro-5/+7
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-27Migrate `inline_type_alias` assist to use `SyntaxEditor`Hmikihiro-29/+34
2025-07-27refactor: conpare text of name_ref instead of syntax name_refHmikihiro-1/+4
2025-07-26Merge pull request #20307 from ↵Laurențiu Nicola-8/+11
Hmikihiro/migrate_extract_expression_from_format_string Migrate `extract_expressions_from_format_string` assist to use `SyntaxEditor`
2025-07-26Migrate `extract_expressions_from_format_string` assist to use `SyntaxEditor`Hayashi Mikihiro-8/+11
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>