1145 Commits

Author SHA1 Message Date
Hmikihiro
feaf647b06 refactor: conpare text of name_ref instead of syntax name_ref 2025-07-27 22:49:56 +09:00
Laurențiu Nicola
ea413f67a8
Merge pull request #20307 from Hmikihiro/migrate_extract_expression_from_format_string
Migrate `extract_expressions_from_format_string` assist to use `SyntaxEditor`
2025-07-26 14:34:56 +00:00
Hayashi Mikihiro
c9abba3c7a Migrate extract_expressions_from_format_string assist to use SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-26 18:23:22 +09:00
Hayashi Mikihiro
92922f5e56 Migrate Convert_to_guarded_return to use SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-26 18:17:09 +09:00
Hayashi Mikihiro
82dfdacb78 Modify around add_trait_assoc_items_to_impl to migrate add_missing_impl_members
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-26 00:22:29 +09:00
Hmikihiro
827e3f7c17 migrate_replace_derive_with_manual_impl 2025-07-25 19:50:44 +09:00
Hmikihiro
4a0527f78c split ted from gen_trait_fn_body 2025-07-25 19:50:44 +09:00
Shoyu Vanilla (Flint)
48ccbe0cd8
Merge pull request #19938 from A4-Tacks/gen-impl-trait
Add ide-assist: generate_impl_trait for generate_impl
2025-07-25 04:16:22 +00:00
A4-Tacks
cf299690a9
Fix generate_trait_from_impl whitespace after vis
Input:

```rust
struct Foo;

impl F$0oo {
    pub fn a_func() -> Option<()> {
        Some(())
    }
}
```

Old:

```rust
struct Foo;

trait NewTrait {
     fn a_func() -> Option<()>;
}

impl NewTrait for Foo {
     fn a_func() -> Option<()> {
        Some(())
    }
}
```

This PR fixed:

```rust
struct Foo;

trait NewTrait {
    fn a_func() -> Option<()>;
}

impl NewTrait for Foo {
    fn a_func() -> Option<()> {
        Some(())
    }
}
```
2025-07-24 15:06:56 +08:00
Shoyu Vanilla (Flint)
bdfc7709bf
Merge pull request #20269 from Hmikihiro/migrate_indent_mapping
Migrate AstNodeEdit::Indent to SyntaxEditor
2025-07-22 04:07:47 +00:00
Shoyu Vanilla (Flint)
7cbc5a3d57
Merge pull request #20270 from Hmikihiro/migrate_generate_new
Migrate `generate new` assist to use `SyntaxEditor`
2025-07-22 03:41:03 +00:00
Hayashi Mikihiro
9cc03e01c5 migrate generate new 2025-07-21 17:22:03 +09:00
Hayashi Mikihiro
6f101d9cc7 Migrate AstNodeEdit 2025-07-21 15:26:48 +09:00
Shoyu Vanilla (Flint)
28ac05d8ed
Merge pull request #20256 from A4-Tacks/gen-mut-trait-deref
Add Deref -> DerefMut for generate_mut_trait_impl
2025-07-21 04:31:24 +00:00
Laurențiu Nicola
58e507d807
Merge pull request #20255 from A4-Tacks/deref-intranstive
Fix ide-assist: generate Deref transitive
2025-07-20 10:54:35 +00:00
A4-Tacks
dfd8434847
Add Deref -> DerefMut for generate_mut_trait_impl 2025-07-19 15:01:13 +08:00
A4-Tacks
53483b4f95
Fix ide-assist: Deref transtive 2025-07-19 13:38:01 +08:00
Shoyu Vanilla (Flint)
4f294fc2a1
Merge pull request #19783 from A4-Tacks/generate-single-field-from
Add ide-assist, generate single field struct From
2025-07-18 01:58:30 +00:00
A4-Tacks
1816d2244e
Use SyntaxEditor 2025-07-18 06:48:15 +08:00
A4-Tacks
6b8e927654
Change tabstop to method tail_expr 2025-07-18 06:18:29 +08:00
A4-Tacks
0b9114fdfc
Add generate_impl_trait for generate_impl 2025-07-18 06:18:23 +08:00
A4-Tacks
aa34fab642
Add tailexpr & -> &mut for generate_mut_trait_impl 2025-07-17 00:49:56 +08:00
A4-Tacks
fc5dd8b798
Use hir::Trait in parameter 2025-07-16 19:51:16 +08:00
A4-Tacks
28f1e62482
Remove redundant type parameters 2025-07-16 17:17:00 +08:00
A4-Tacks
a977cb1ce8
Add AsRef and Borrow for generate_mut_trait_impl
- AsRef -> AsMut
- Borrow -> BorrowMut

Example
====================

```rust
//- minicore: as_ref
struct Foo(i32);

impl<T> core::convert::AsRef$0<i32> for Foo {
    fn as_ref(&self) -> &i32 {
        &self.0
    }
}
```
->
```rust
struct Foo(i32);

$0impl<T> core::convert::AsMut<i32> for Foo {
    fn as_mut(&mut self) -> &mut i32 {
        &self.0
    }
}

impl<T> core::convert::AsRef<i32> for Foo {
    fn as_ref(&self) -> &i32 {
        &self.0
    }
}
```
2025-07-16 17:16:56 +08:00
Hayashi Mikihiro
435b2962a0 remove remove_default 2025-07-13 02:03:56 +09:00
Shoyu Vanilla (Flint)
eaeee0be5a
Merge pull request #20224 from Hmikihiro/migrate_remove_dbg
Migrate `remove_dbg` assist to use `SyntaxEditor`
2025-07-11 07:41:34 +00:00
Hayashi Mikihiro
c79e24c1f1 Migrate remove_dbg assist to use SyntaxEditor 2025-07-11 16:24:57 +09:00
Hayashi Mikihiro
c3a5a8c22a Migrate generate_impl assist to use SyntaxEditor 2025-07-10 18:12:16 +09:00
Laurențiu Nicola
8789098dbc Revert "remove if-let chains"
This reverts commit fcc81a38b3ed55447735f71e8d374fcb36c22f24.
2025-07-10 08:24:53 +03:00
Hayashi Mikihiro
be609a57bf Migrate convert_match_to_let_else assist to use SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-10 11:22:32 +09:00
Hayashi Mikihiro
5a410c3215 migrate convert_named_struct_to_tuple_struct assist to use 'SyntaxEditor'
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-10 01:01:47 +09:00
Shoyu Vanilla (Flint)
64551a5696
Merge pull request #20109 from Hmikihiro/generate_new_tuple_field
feat: Generate `new` for tuple struct
2025-07-09 15:22:47 +00:00
Hayashi Mikihiro
c6ce2abd47 Migrate pull_assignment_up assist to SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-09 00:58:58 +09:00
Lukas Wirth
2c01609d6d minor: Handle match arm commas in make::match_arm
Co-authored-by: Giga Bowser <45986823+Giga-Bowser@users.noreply.github.com>
2025-07-04 11:08:28 +02:00
Hayashi Mikihiro
c0ca61b8ff Migrate unmerge_match_arm Assist to use SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-04 02:32:55 +09:00
Lukas Wirth
a1f548bce2
Merge pull request #20156 from Veykril/push-knkzxuxkzoyx
Restructure proc-macro loading erros, differentiate hard error property on kind
2025-07-03 07:40:17 +00:00
Lukas Wirth
e54759083a Restructure proc-macro loading erros, differentiate hard error property on kind 2025-07-03 09:28:53 +02:00
Hayashi Mikihiro
0b7ad9cd0f Migrate wrap_unwrap_cfg_attr assist to use SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-02 01:18:22 +09:00
Hayashi Mikihiro
3af0f4f6be Migrate toggle_macro_delimiter assist to SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-01 22:40:31 +09:00
Hayashi Mikihiro
a423b7c7cc Migrate promote_local_to_const Assist to SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-01 20:11:52 +09:00
Hayashi Mikihiro
fcc81a38b3 remove if-let chains
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-01 18:38:50 +09:00
Hayashi Mikihiro
f6a247dc57 Migrate replace_is_method_with_if_let_method Assist to use SyntaxFactory
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-01 17:19:16 +09:00
Hayashi Mikihiro
a78cf7596c use placeholder_snippet
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-06-27 18:49:08 +09:00
Hayashi Mikihiro
cd4fadb4ea use name_generator
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-06-27 18:48:39 +09:00
Hayashi Mikihiro
720f9f12fc generate new for tuple field
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-06-27 02:39:04 +09:00
Lukas Wirth
d3e6dcd3ca Adjust minicore for Sized Hierarchy changes 2025-06-25 21:51:51 +09:00
Lukas Wirth
ee012e0749
Merge pull request #20061 from ChayimFriedman2/wrap-ret-ty
fix: In "Wrap return type" assist, don't wrap exit points if they already have the right type
2025-06-24 07:16:46 +00:00
Shoyu Vanilla
254c6ec8e1 fix: Use ROOT hygiene for args inside new format_args! expansion 2025-06-24 01:10:32 +09:00
Chayim Refael Friedman
78427be4d7 In "Wrap return type" assist, don't wrap exit points if they already have the right type 2025-06-23 00:45:40 +03:00