From 75a012361409349d0325c9232e0c8fe8d52de505 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 17 May 2021 12:41:48 +0300 Subject: fix: don't add extra whitespace around fields closes #8785 --- .../src/diagnostics/fixes/fill_missing_fields.rs | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'crates/ide/src/diagnostics') diff --git a/crates/ide/src/diagnostics/fixes/fill_missing_fields.rs b/crates/ide/src/diagnostics/fixes/fill_missing_fields.rs index 123c2f0af..37a0e37a9 100644 --- a/crates/ide/src/diagnostics/fixes/fill_missing_fields.rs +++ b/crates/ide/src/diagnostics/fixes/fill_missing_fields.rs @@ -186,6 +186,31 @@ fn test_fn() { let one = 1; let s = TestStruct{ ..a }; } +"#, + ); + } + + #[test] + fn test_fill_struct_fields_blank_line() { + check_fix( + r#" +struct S { a: (), b: () } + +fn f() { + S { + $0 + }; +} +"#, + r#" +struct S { a: (), b: () } + +fn f() { + S { + a: (), + b: (), + }; +} "#, ); } -- cgit v1.2.3