Skip to content

Conversation

@jjvn84
Copy link
Contributor

@jjvn84 jjvn84 commented Jul 13, 2025

This PR modifies the behaviour of dx fmt to add back comments removed from expressions when parsing the code to reformat it. It should only affect expressions used in attributes for rsx elements.

Fixes #2524

@jjvn84 jjvn84 requested a review from a team as a code owner July 13, 2025 22:45
@jjvn84 jjvn84 marked this pull request as draft July 14, 2025 13:59
@ealmloff ealmloff added bug Something isn't working autoformatting Related to the autofmt crate labels Jul 14, 2025
@jjvn84 jjvn84 marked this pull request as ready for review July 15, 2025 21:19
@jkelleyrtp
Copy link
Member

Thanks for the PR!

I just opened a similar PR to fix whitespace removal from the end of rsx blocks here:

#4423

Hopefully with these two PRs all whitespace should be handled properly!

@jkelleyrtp
Copy link
Member

Ended up adding a few more test cases and inverting the line pull logic to pull whitespace on top of pretty lines instead of pretty lines under whitespace.

Thanks for the really clever solution here - been something I've been meaning to fix for a long time and it was nice to see a PR popup fixing it :)

@jkelleyrtp jkelleyrtp merged commit 54d465a into DioxusLabs:main Jul 16, 2025
20 checks passed
@jjvn84 jjvn84 deleted the issue2524 branch November 18, 2025 15:34
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.

dx fmt removes comments in expressions

3 participants