Open bobhy opened 3 days ago
Probably related to #155 ... In my scenario, leptosfmt is simply removing a comment. version 0.1.32
leptosfmt
before:
#[test] fn test_s2() { #[component] pub fn App() -> impl IntoView { view! { // ANCHOR: s2 <Routes fallback=|| "Not found."> <Route path=path!("/") view=Home /> <ParentRoute path=path!("/users") view=Users> <Route path=path!(":id") view=UserProfile /> </ParentRoute> <Route path=path!("/*any") view=|| view! { <h1>"Not Found"</h1> } /> </Routes> // ANCHOR_END: s2 } } }
after:
#[test] fn test_s2() { #[component] pub fn App() -> impl IntoView { view! { // ANCHOR: s2 <Routes fallback=|| "Not found."> <Route path=path!("/") view=Home /> <ParentRoute path=path!("/users") view=Users> <Route path=path!(":id") view=UserProfile /> </ParentRoute> <Route path=path!("/*any") view=|| view! { <h1>"Not Found"</h1> } /> </Routes> } } }
This is bad because rustdoc depends on the comment being where it is to properly format a code snippet for my doc book.
rustdoc
It doesn't matter whether the comment is // xxx or /* xxx */. If I move the comment just outside the closing } of the view macro, it is left alone.
// xxx
/* xxx */
}
Probably related to #155 ... In my scenario,
leptosfmt
is simply removing a comment. version 0.1.32before:
after:
This is bad because
rustdoc
depends on the comment being where it is to properly format a code snippet for my doc book.It doesn't matter whether the comment is
// xxx
or/* xxx */
. If I move the comment just outside the closing}
of the view macro, it is left alone.