Selaa lähdekoodia

chore: add todo list to autofmt crate

Jonathan Kelley 3 vuotta sitten
vanhempi
commit
64d669e934

+ 12 - 0
packages/autofmt/README.md

@@ -3,3 +3,15 @@
 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
+- [ ] Nested RSX calls (important) - unnecessary but desirable
+- [ ] RSX edits overstepping each other
+- [ ] Collapse components and elements under syntax -
+- [ ] Don't eat comments in exprs
+- [ ] Format regular exprs
+- [ ] Fix prettyplease around chaining
+- [ ] Don't eat comments in prettyplease

+ 0 - 1
packages/autofmt/src/element.rs

@@ -2,7 +2,6 @@ use crate::Buffer;
 use dioxus_rsx::*;
 use proc_macro2::Span;
 use std::{fmt::Result, fmt::Write};
-use syn::spanned::Spanned;
 
 #[derive(Debug)]
 enum ShortOptimization {

+ 11 - 0
packages/autofmt/tests/fil.rs

@@ -40,3 +40,14 @@ fn comment_attr_case_work() {
 
     println!("{}", out);
 }
+
+#[test]
+fn tiny() {
+    // todo: get oneliner rsx working
+    let _src = include_str!("./samples/tiny.rsx");
+
+    // let formatted = dioxus_autofmt::fmt_file(src);
+    // let out = dioxus_autofmt::apply_formats(src, formatted);
+
+    // println!("{}", out);
+}

+ 1 - 0
packages/autofmt/tests/samples/tiny.rsx

@@ -0,0 +1 @@
+rsx! { div {} }