Merge branch 'main' into fix-deprecated-interpolated-formatting

This commit is contained in:
Joshua Warner 2024-07-29 17:40:23 -07:00 committed by GitHub
commit ca037c5d0e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
44 changed files with 4321 additions and 127 deletions

View file

@ -38,7 +38,9 @@ Defs(
},
],
},
comment: None,
lines_between: [
Newline,
],
body_pattern: @28-31 Identifier {
ident: "foo",
},

View file

@ -40,7 +40,9 @@ Defs(
},
],
},
comment: None,
lines_between: [
Newline,
],
body_pattern: @29-32 Identifier {
ident: "foo",
},

View file

@ -32,7 +32,9 @@ SpaceAfter(
"Foo",
[],
),
comment: None,
lines_between: [
Newline,
],
body_pattern: @15-23 RecordDestructure(
[
@17-18 Identifier {

View file

@ -42,7 +42,9 @@ SpaceAfter(
},
],
},
comment: None,
lines_between: [
Newline,
],
body_pattern: @26-34 Apply(
@26-32 Tag(
"UserId",

View file

@ -32,7 +32,9 @@ SpaceAfter(
"Foo",
[],
),
comment: None,
lines_between: [
Newline,
],
body_pattern: @15-23 Tuple(
[
@17-18 Identifier {

View file

@ -62,7 +62,9 @@ Defs {
},
],
),
comment: None,
lines_between: [
Newline,
],
body_pattern: @30-34 Identifier {
ident: "html",
},
@ -166,7 +168,9 @@ Defs {
],
ext: None,
},
comment: None,
lines_between: [
Newline,
],
body_pattern: @190-196 Identifier {
ident: "actual",
},
@ -246,7 +250,9 @@ Defs {
],
ext: None,
},
comment: None,
lines_between: [
Newline,
],
body_pattern: @326-334 Identifier {
ident: "expected",
},

View file

@ -52,7 +52,9 @@ Defs(
[],
),
),
comment: None,
lines_between: [
Newline,
],
body_pattern: @45-50 Identifier {
ident: "table",
},

View file

@ -52,7 +52,9 @@ SpaceAfter(
),
},
),
comment: None,
lines_between: [
Newline,
],
body_pattern: @21-22 Identifier {
ident: "f",
},

View file

@ -44,7 +44,9 @@ SpaceAfter(
ext: None,
},
),
comment: None,
lines_between: [
Newline,
],
body_pattern: @22-23 Identifier {
ident: "f",
},

View file

@ -57,7 +57,9 @@ Defs {
[],
),
),
comment: None,
lines_between: [
Newline,
],
body_pattern: @43-55 Identifier {
ident: "wrappedNotEq",
},

View file

@ -53,7 +53,9 @@ Defs(
ext: None,
},
),
comment: None,
lines_between: [
Newline,
],
body_pattern: @28-29 Identifier {
ident: "f",
},

View file

@ -61,7 +61,9 @@ Defs(
),
},
),
comment: None,
lines_between: [
Newline,
],
body_pattern: @30-31 Identifier {
ident: "f",
},

View file

@ -24,7 +24,9 @@ Defs(
"Int",
[],
),
comment: None,
lines_between: [
Newline,
],
body_pattern: @10-13 Identifier {
ident: "foo",
},

View file

@ -38,7 +38,9 @@ Defs(
[],
),
),
comment: None,
lines_between: [
Newline,
],
body_pattern: @25-28 Identifier {
ident: "foo",
},

View file

@ -34,7 +34,9 @@ SpaceAfter(
],
ext: None,
},
comment: None,
lines_between: [
Newline,
],
body_pattern: @21-26 Identifier {
ident: "where",
},

View file

@ -6231,13 +6231,108 @@ mod test_fmt {
[first as last]
| [first, last] ->
first
_ -> Not
"
),
);
}
#[test]
fn preserve_annotated_body() {
expr_formats_same(indoc!(
r"
x : i32
x = 1
x
"
));
}
#[test]
fn preserve_annotated_body_comment() {
expr_formats_same(indoc!(
r"
x : i32 # comment
x = 1
x
"
));
}
#[test]
fn preserve_annotated_body_comments() {
expr_formats_same(indoc!(
r"
x : i32
# comment
# comment 2
x = 1
x
"
));
}
#[test]
fn preserve_annotated_body_comments_without_newlines() {
expr_formats_to(
indoc!(
r"
x : i32
# comment
# comment 2
x = 1
x
"
),
indoc!(
r"
x : i32
# comment
# comment 2
x = 1
x
"
),
);
}
#[test]
fn preserve_annotated_body_blank_comment() {
expr_formats_same(indoc!(
r"
x : i32
#
x = 1
x
"
));
}
#[test]
fn preserve_annotated_body_without_newlines() {
expr_formats_to(
indoc!(
r"
x : i32
x = 1
x
"
),
indoc!(
r"
x : i32
x = 1
x
"
),
);
}
// this is a parse error atm
// #[test]
// fn multiline_apply() {