Skip to content

Commit 532be0e

Browse files
committed
Added test for impl member assist when impl def is missing braces
1 parent 9724af0 commit 532be0e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

crates/assists/src/handlers/add_missing_impl_members.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,25 @@ impl Foo for S {
313313
);
314314
}
315315

316+
#[test]
317+
fn test_impl_def_without_braces() {
318+
check_assist(
319+
add_missing_impl_members,
320+
r#"
321+
trait Foo { fn foo(&self); }
322+
struct S;
323+
impl Foo for S<|>"#,
324+
r#"
325+
trait Foo { fn foo(&self); }
326+
struct S;
327+
impl Foo for S {
328+
fn foo(&self) {
329+
${0:todo!()}
330+
}
331+
}"#,
332+
);
333+
}
334+
316335
#[test]
317336
fn fill_in_type_params_1() {
318337
check_assist(

0 commit comments

Comments
 (0)