Commit graph

1294 commits

Author SHA1 Message Date
Shoyu Vanilla (Flint)
0358021a8f
Merge pull request #20534 from A4-Tacks/tog-macro-delim-semicolon
Fix ExprStmt delete semicolon for toggle_macro_delimiter
2025-08-26 05:55:08 +00:00
Shoyu Vanilla (Flint)
d86cf448c3
Merge pull request #20509 from A4-Tacks/fix-move-guard-to-arm-indent
Fix indent for move_guard_to_arm_body
2025-08-26 05:52:06 +00:00
Chayim Refael Friedman
870cb3329b
Merge pull request #20423 from ShoyuVanilla/import-2024
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Make import sorting order follow 2024 edition style
2025-08-25 19:19:31 +00:00
A4-Tacks
55b1ddbcc3
Fix ExprStmt delete semicolon for toggle_macro_delimiter 2025-08-25 16:45:12 +08:00
Chayim Refael Friedman
35369557a6
Merge pull request #20512 from A4-Tacks/arith-op-not-on-selected
replace_arith_op not applicable on selected
2025-08-24 00:17:09 +00:00
A4-Tacks
0fe2d7ffa1
replace_arith_op not applicable on selected 2025-08-24 07:57:50 +08:00
Chayim Refael Friedman
413ed5a361
Merge pull request #20511 from A4-Tacks/fix-conv-int-lit-on-selected
convert_integer_literal not on selected
2025-08-23 22:03:17 +00:00
A4-Tacks
5f8cfeb3f4
fix: convert_integer_literal not on selected
`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-22 17:13:30 +08:00
A4-Tacks
f5f797e2d3
Fix indent for move_guard_to_arm_body
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-22 11:43:03 +08:00
lcnr
1d4f709e60 user facing code should use not use PostAnalysis 2025-08-19 08:24:34 +02:00
Lukas Wirth
aed0fec1a9 Auto-attach database in Analysis calls 2025-08-18 09:52:23 +02:00
Shoyu Vanilla (Flint)
becf04b67a
Merge pull request #20442 from ChayimFriedman2/unqualify
fix: Only import the item in "Unqualify method call" if needed
2025-08-18 06:24:35 +00:00
Shoyu Vanilla (Flint)
4d7b9044c3
Merge pull request #20455 from A4-Tacks/fix-indent-conv-match-to-let-else
Fix indent for convert_match_to_let_else
2025-08-14 08:23:48 +00:00
Shoyu Vanilla (Flint)
83b852353a
Merge pull request #20456 from A4-Tacks/match-with-if-let-guard
Add guard to let-chain for replace_match_with_if_let
2025-08-14 08:22:05 +00:00
A4-Tacks
8399a88e99
Add guard to let-chain for replace_match_with_if_let
```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-14 10:07:25 +08:00
A4-Tacks
e797f81f2a
Fix indent for convert_match_to_let_else
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-14 08:34:31 +08:00
Deadbeef
82f174fbd9 Merge Trait and TraitAlias handling 2025-08-13 15:28:08 +08:00
Lukas Wirth
a9450ebba3
Merge pull request #20329 from jackh726/next-trait-solver-querify
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Switch from Chalk to the next trait solver
2025-08-13 06:10:45 +00:00
Chayim Refael Friedman
8c1c689977 Only import the item in "Unqualify method call" if needed 2025-08-13 05:23:58 +03:00
sgasho
8ab683759e fix: Implement default member to resolve IdentPat 2025-08-12 21:53:50 +09:00
Shoyu Vanilla
635b536f11 Make import sorting order follow 2024 edition style 2025-08-12 00:01:46 +09:00
A4-Tacks
62508aaca1
Fix extract_expressions_from_format_string on write!
**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-10 14:45:54 +08:00
jackh726
9418a3f2df Implement next trait solver 2025-08-09 16:08:58 +00:00
Hmikihiro
cfd41034e2 fix: generate function by indet token 2025-08-09 15:48:10 +09:00
Hmikihiro
fcd4010b03 In extract_module.rs, generate ast::Module instead of String 2025-08-07 02:29:59 +09:00
Chayim Refael Friedman
4b49c7bf3d
Merge pull request #20354 from A4-Tacks/clean-lit-stmt-remove-dbg
Add remove literal dbg stmt for remove_dbg
2025-08-06 13:45:51 +00:00
A4-Tacks
75fd004dec
Add remove simple dbg stmt for remove_dbg
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-06 21:33:10 +08:00
Shoyu Vanilla (Flint)
2e283c1106
Merge pull request #20385 from Hmikihiro/migrate_expand_glob_import
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Migrate `expand_glob_import` assist to use `SyntaxEditor`
2025-08-05 09:47:09 +00:00
Shoyu Vanilla (Flint)
6600a1a18b
Merge pull request #20383 from Hmikihiro/remove_ted_from_replace_named_generic_with_impl
remove `ted` from replace_named_generic_with_impl.rs
2025-08-05 09:43:32 +00:00
Hmikihiro
0e456af6a1 Migrate expand_glob_import assist to use SyntaxEditor 2025-08-05 01:16:57 +09:00
Hmikihiro
d2588a723d remove ted from replace_named_generic_with_impl.rs 2025-08-05 00:51:50 +09:00
Hmikihiro
c57a42acf3 remvoe add_attr edit_in_place.rs because it use ted. 2025-08-04 21:52:49 +09:00
Lukas Wirth
531a02c824
Merge pull request #20371 from Hmikihiro/migrate_generate_trait_from_impl
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Migrate `generate_trait_from_impl` assist to use `SyntaxEditor`
2025-08-03 07:23:07 +00:00
Hmikihiro
24f7f739d7 Migrate generate_trait_from_impl assist to use SyntaxEditor 2025-08-03 16:12:08 +09:00
Lukas Wirth
99526ef6ef
Merge pull request #20368 from Hmikihiro/migrate_delegate_methods
Migrate `generate_delegate_methods` assist to use `SyntaxEditor`
2025-08-03 06:37:22 +00:00
Hmikihiro
85f7112c0e Migrate generate_delegate_methods assist to use SyntaxEditor 2025-08-03 02:17:56 +09:00
Hmikihiro
c2275c28e1 Migrate convert_from_to_tryfrom assist to use SyntaxEditor 2025-08-02 20:35:09 +09:00
Shoyu Vanilla (Flint)
68e7ec90bf
Merge pull request #20345 from Hmikihiro/Migrate_add_trait_assoc_items_to_impl
Some checks failed
metrics / build_metrics (push) Has been cancelled
rustdoc / rustdoc (push) Has been cancelled
metrics / other_metrics (diesel-1.4.8) (push) Has been cancelled
metrics / other_metrics (hyper-0.14.18) (push) Has been cancelled
metrics / other_metrics (ripgrep-13.0.0) (push) Has been cancelled
metrics / other_metrics (self) (push) Has been cancelled
metrics / other_metrics (webrender-2022) (push) Has been cancelled
metrics / generate_final_metrics (push) Has been cancelled
add `SyntaxEditor::delete_all` to migrate utils.rs `add_trait_assoc_items_to_impl`
2025-07-31 15:11:22 +00:00
Lukas Wirth
8ce30264c8 cargo clippy --fix 2025-07-31 10:55:10 +02:00
Hmikihiro
e600060680 add SyntaxEditor::delete_all to migrate utils.rs add_trait_assoc_items_to_impl 2025-07-30 23:53:05 +09:00
Shoyu Vanilla (Flint)
8611b71459
Merge pull request #20314 from Hmikihiro/Migrate_inline_type_alias_to_syntax_editor
Some checks failed
metrics / build_metrics (push) Has been cancelled
rustdoc / rustdoc (push) Has been cancelled
metrics / other_metrics (diesel-1.4.8) (push) Has been cancelled
metrics / other_metrics (hyper-0.14.18) (push) Has been cancelled
metrics / other_metrics (ripgrep-13.0.0) (push) Has been cancelled
metrics / other_metrics (self) (push) Has been cancelled
metrics / other_metrics (webrender-2022) (push) Has been cancelled
metrics / generate_final_metrics (push) Has been cancelled
Migrate `inline_type_alias` assist to use `syntax_editor`
2025-07-30 01:24:17 +00:00
Shoyu Vanilla (Flint)
b0d2487ea6
Merge pull request #20311 from Hmikihiro/migrate_convert_tuple_struct_to_named_struct
Migrate `convert_tuple_struct_to_named_struct` assist to use `SyntaxEditor`
2025-07-30 01:22:35 +00:00
Hmikihiro
8583e35e4c replace make:: to SyntaxFactory:: in inline_type_alias 2025-07-29 23:25:13 +09:00
Hmikihiro
ec02abf97a add SyntaxFactory::record_expr to hide clone_for_update 2025-07-29 21:49:03 +09:00
Lukas Wirth
06dc35840c
Merge pull request #20336 from ChayimFriedman2/mut-trait-impl-snippet
fix: In generate_mut_trait_impl, don't add a tabstop if the client does not support snippets
2025-07-29 10:12:14 +00:00
Chayim Refael Friedman
8394155fe6 In generate_mut_trait_impl, don't add a tabstop if the client does not support snippets 2025-07-29 12:37:06 +03:00
Chayim Refael Friedman
4f407685b4
Merge pull request #20300 from A4-Tacks/fix-debug_assert-doc-gen
Fix gen panics doc template for debug_assert
2025-07-29 05:56:59 +00:00
Shoyu Vanilla (Flint)
3a0cf54236
Merge pull request #20303 from Hmikihiro/migrate_path_transform
Migrate path transform
2025-07-28 13:33:08 +00:00
Shoyu Vanilla (Flint)
971c393ab3
Merge pull request #20305 from Hmikihiro/Migrate_part_of_utils
Some checks are pending
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Migrate part of utils.rs to use SyntaxEditor
2025-07-27 14:43:01 +00:00
Hayashi Mikihiro
475ebb8fef Migrate convert_tuple_struct_to_named_struct' assist to use SyntaxEditor'
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-27 22:56:24 +09:00