aboutsummaryrefslogtreecommitdiff
path: root/crates/assists
diff options
context:
space:
mode:
authorMatt Hooper <[email protected]>2020-09-21 00:43:03 +0100
committerMatt Hooper <[email protected]>2020-09-21 09:48:51 +0100
commit532be0e780e1f27e4669c8c032d364504c89b02e (patch)
tree343b95a9027bf360070590f63edda3ff694b9c8b /crates/assists
parent9724af038b60331fc0205e14707700c4e93d7c35 (diff)
Added test for impl member assist when impl def is missing braces
Diffstat (limited to 'crates/assists')
-rw-r--r--crates/assists/src/handlers/add_missing_impl_members.rs19
1 files changed, 19 insertions, 0 deletions
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
@@ -314,6 +314,25 @@ impl Foo for S {
314 } 314 }
315 315
316 #[test] 316 #[test]
317 fn test_impl_def_without_braces() {
318 check_assist(
319 add_missing_impl_members,
320 r#"
321trait Foo { fn foo(&self); }
322struct S;
323impl Foo for S<|>"#,
324 r#"
325trait Foo { fn foo(&self); }
326struct S;
327impl Foo for S {
328 fn foo(&self) {
329 ${0:todo!()}
330 }
331}"#,
332 );
333 }
334
335 #[test]
317 fn fill_in_type_params_1() { 336 fn fill_in_type_params_1() {
318 check_assist( 337 check_assist(
319 add_missing_impl_members, 338 add_missing_impl_members,