diff --git a/crates/assists/src/handlers/add_missing_impl_members.rs b/crates/assists/src/handlers/add_missing_impl_members.rs index e413505d3e..7df05b8412 100644 --- a/crates/assists/src/handlers/add_missing_impl_members.rs +++ b/crates/assists/src/handlers/add_missing_impl_members.rs @@ -15,7 +15,7 @@ use crate::{ // // ``` // trait Trait { -// Type X; +// type X; // fn foo(&self) -> T; // fn bar(&self) {} // } @@ -27,14 +27,16 @@ use crate::{ // -> // ``` // trait Trait { -// Type X; +// type X; // fn foo(&self) -> T; // fn bar(&self) {} // } // // impl Trait for () { +// $0type X; +// // fn foo(&self) -> u32 { -// ${0:todo!()} +// todo!() // } // } // ``` @@ -54,13 +56,13 @@ pub(crate) fn add_missing_impl_members(acc: &mut Assists, ctx: &AssistContext) - // // ``` // trait Trait { -// Type X; +// type X; // fn foo(&self); // fn bar(&self) {} // } // // impl Trait for () { -// Type X = (); +// type X = (); // fn foo(&self) {}<|> // // } @@ -68,13 +70,13 @@ pub(crate) fn add_missing_impl_members(acc: &mut Assists, ctx: &AssistContext) - // -> // ``` // trait Trait { -// Type X; +// type X; // fn foo(&self); // fn bar(&self) {} // } // // impl Trait for () { -// Type X = (); +// type X = (); // fn foo(&self) {} // // $0fn bar(&self) {} diff --git a/crates/assists/src/tests/generated.rs b/crates/assists/src/tests/generated.rs index e9093ec536..d3dfe24e7c 100644 --- a/crates/assists/src/tests/generated.rs +++ b/crates/assists/src/tests/generated.rs @@ -42,26 +42,26 @@ fn doctest_add_impl_default_members() { "add_impl_default_members", r#####" trait Trait { - Type X; + type X; fn foo(&self); fn bar(&self) {} } impl Trait for () { - Type X = (); + type X = (); fn foo(&self) {}<|> } "#####, r#####" trait Trait { - Type X; + type X; fn foo(&self); fn bar(&self) {} } impl Trait for () { - Type X = (); + type X = (); fn foo(&self) {} $0fn bar(&self) {} @@ -76,7 +76,7 @@ fn doctest_add_impl_missing_members() { "add_impl_missing_members", r#####" trait Trait { - Type X; + type X; fn foo(&self) -> T; fn bar(&self) {} } @@ -87,14 +87,16 @@ impl Trait for () {<|> "#####, r#####" trait Trait { - Type X; + type X; fn foo(&self) -> T; fn bar(&self) {} } impl Trait for () { + $0type X; + fn foo(&self) -> u32 { - ${0:todo!()} + todo!() } } "#####,