You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ echo -e 'fn bar(){\n// comment in rust\nview!{\n if true {\n // comment in view\n let x = 42;\n view!{ X } view!{ Y }}\n}}' | rustfmt
fn bar() {
// comment in rust
view! {
if true {
// comment in view
let x = 42;
view!{ X } view!{ Y }}
}
}
$ echo -e 'fn bar(){\n// comment in rust\nview!{\n if true {\n // comment in view\n let x = 42;\n view!{ X } view!{ Y }}\n}}' | leptosfmt -s --ru
stfmt
fn bar() {
// comment in rust
view! {
if true
{
let x = 42;
view! {
// comment in view
X
}
view! {
// comment in view
Y
}
}
}
}
Comment gets moved into all the following view!s
The text was updated successfully, but these errors were encountered:
Hi, this is expected behaviour. See the readme on non-doc comments for an explanation.
Regular comments are supported in the view! macro, but not inside rust code that resides within the view! macro.
fn bar() {
// comment in rust
view! {
if true
{
// comment in view <- this is a comment in a rust code block inside a view and therefore is stripped out by the `prettyplease` crate
let x = 42;
view! {
// comment in view
X
}
view! {
// comment in view
Y
}
}
}
}
Originall reported in #106 (comment)
Small example:
Comment gets moved into all the following
view!
sThe text was updated successfully, but these errors were encountered: