Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix collapsing of multiline components and rsx!{} calls #2849

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

jkelleyrtp
Copy link
Member

@jkelleyrtp jkelleyrtp commented Aug 15, 2024

These two cases were annoying me but are now fixed.
Just random regressions that slipped through with the refactor/cleanup.

This was getting collapsed:

        Fragment {
            Fragment {
                Fragment {
                    Fragment {
                        Fragment { 
	                        div { "Finally have a real node!" } 
                        }
                    }
                }
            }
        }

We were randomly injecting more spaces than we should have

return rsx!();
return rsx!(  );

There's still a few more issues I'm not addressing here:

// this is getting collapsed to one line when I'd rather it not - all closures should force a newline
FancyButton { 
    onclick: move |event| println!("Clicked! {event:?}"), 
}

// we're just eating comments completely with empty
rsx! {
   // please dont kill me :/
}

// we're also eating trailing comments, which I thought we fixed. Sometimes it saves them but with wrong indentation
rsx! {
   div {}
   // please dont kill me :/
}

@jkelleyrtp jkelleyrtp added autoformatting Related to the autofmt crate bug Something isn't working labels Aug 15, 2024
@jkelleyrtp jkelleyrtp requested a review from ealmloff August 15, 2024 23:44
@jkelleyrtp jkelleyrtp merged commit c21b44a into main Aug 16, 2024
15 checks passed
@jkelleyrtp jkelleyrtp deleted the jk/autofmt-collapse branch August 16, 2024 00:04
@jkelleyrtp jkelleyrtp added this to the 0.6.0 milestone Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autoformatting Related to the autofmt crate bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants