Fixes to autofmt, make it more aggressive (#2230)
* fix: fmt unterminated if, be more aggressive with line splits * Fix: Handle long exprs in for/if statements
This commit is contained in:
1 parent
46b0eeb12c
commit
be99e29e5f
31 files changed
+464
-117
No files matched your search
@@ -16,6 +16,8 @@ fn raw_attribute() {
|
||||
let out = dioxus_autofmt::write_block_out(body).unwrap();
|
||||
|
||||
let expected = r#"
|
||||
div { div { "unrecognizedattribute": "asd", "hello world!" } }"#;
|
||||
div {
|
||||
div { "unrecognizedattribute": "asd", "hello world!" }
|
||||
}"#;
|
||||
pretty_assertions::assert_eq!(&out, &expected);
|
||||
}
|
||||
@@ -56,7 +56,9 @@ fn deeply_nested() {
|
||||
div {
|
||||
div { class: "asd",
|
||||
div { class: "asd",
|
||||
div { class: "asd", div { class: "asd" } }
|
||||
div { class: "asd",
|
||||
div { class: "asd" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}"#;
|
||||
|
||||
@@ -16,6 +16,8 @@ fn web_components_translate() {
|
||||
let out = dioxus_autofmt::write_block_out(body).unwrap();
|
||||
|
||||
let expected = r#"
|
||||
div { my-component {} }"#;
|
||||
div {
|
||||
my-component {}
|
||||
}"#;
|
||||
pretty_assertions::assert_eq!(&out, &expected);
|
||||
}
|
||||
Reference in new issue
Block a user