mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
parent
21918c6f5e
commit
75a0123614
2 changed files with 29 additions and 0 deletions
|
@ -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: (),
|
||||
};
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -378,6 +378,10 @@ impl ast::RecordExprFieldList {
|
|||
make::tokens::single_space()
|
||||
};
|
||||
|
||||
if is_multiline {
|
||||
normalize_ws_between_braces(self.syntax());
|
||||
}
|
||||
|
||||
let position = match self.fields().last() {
|
||||
Some(last_field) => {
|
||||
let comma = match last_field
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue