ソースを参照

chore: update readme and tests for autofmt

Jonathan Kelley 3 年 前
コミット
575f92d2d4

+ 1 - 1
packages/autofmt/README.md

@@ -7,7 +7,7 @@ This crate formats rsx! by parsing call bodies and pretty-printing them back out
 # Todo:
 Sorted roughly in order of what's possible
 
-- [ ] Oneline rsx! calls - blocker because this wrecks formatting
+- [x] Oneline rsx! calls - blocker because this wrecks formatting
 - [ ] Nested RSX calls (important) - unnecessary but desirable
 - [ ] RSX edits overstepping each other
 - [ ] Collapse components and elements under syntax -

+ 7 - 0
packages/autofmt/tests/samples/simple.rsx

@@ -34,4 +34,11 @@ rsx! {
 
     // Components
     Component { ..Props {} }
+
+    // multiline
+    div {
+        class: "asdaskjdhaskjdjaslkdjlakdjaslkdjaslkd asdaskjdhaskjdjaslkdjlakdjaslkdjaslkdasdaskjdhaskjdjaslkdjlakdjaslkdjaslkd",
+        multiple: "asd",
+        "hi"
+    }
 }

+ 0 - 16
packages/autofmt/tests/wrong.rs

@@ -12,19 +12,3 @@ macro_rules! twoway {
 }
 
 twoway!("comments" => comments);
-
-// rsx! {
-//     div { class: "asdasd", "hello world" }
-//     h1 {
-//         // Important handler
-//         onclick: move |_| {
-//             let a = 10;
-//         },
-
-//         div { "hello" }
-
-//         // Important handler
-//         "Goodbye world"
-//     }
-//     Component {}
-// }