From 532be0e780e1f27e4669c8c032d364504c89b02e Mon Sep 17 00:00:00 2001 From: Matt Hooper Date: Mon, 21 Sep 2020 00:43:03 +0100 Subject: Added test for impl member assist when impl def is missing braces --- .../assists/src/handlers/add_missing_impl_members.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'crates/assists') diff --git a/crates/assists/src/handlers/add_missing_impl_members.rs b/crates/assists/src/handlers/add_missing_impl_members.rs index e6f72f4bd..01cf95222 100644 --- a/crates/assists/src/handlers/add_missing_impl_members.rs +++ b/crates/assists/src/handlers/add_missing_impl_members.rs @@ -313,6 +313,25 @@ impl Foo for S { ); } + #[test] + fn test_impl_def_without_braces() { + check_assist( + add_missing_impl_members, + r#" +trait Foo { fn foo(&self); } +struct S; +impl Foo for S<|>"#, + r#" +trait Foo { fn foo(&self); } +struct S; +impl Foo for S { + fn foo(&self) { + ${0:todo!()} + } +}"#, + ); + } + #[test] fn fill_in_type_params_1() { check_assist( -- cgit v1.2.3