Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
staging-devin-ai-integration
Bot
force-pushed
the
devin/1785764450-jsx-autofmt
branch
from
September 24, 2026 22:28
7d976b7 to
cb26453
Compare
staging-devin-ai-integration
Bot
force-pushed
the
devin/1785764450-jsx-autofmt
branch
from
October 3, 2026 14:38
161412d to
6e208dc
Compare
staging-devin-ai-integration
Bot
force-pushed
the
devin/1785764450-jsx-autofmt
branch
from
October 3, 2026 14:57
6e208dc to
e6ebabf
Compare
staging-devin-ai-integration
Bot
force-pushed
the
devin/1785764450-jsx-autofmt
branch
from
October 3, 2026 15:02
e6ebabf to
a716fc7
Compare
staging-devin-ai-integration
Bot
force-pushed
the
devin/1785764450-jsx-autofmt
branch
from
October 3, 2026 15:26
a716fc7 to
39afdd6
Compare
Nodes written in the tag syntax (`NodeDelimiter::Tag`) are written back out in that syntax by a new `write_tag` instead of being rewritten into the block syntax. - self-closing tags for empty bodies, a single short child is inlined - attributes stay in the open tag when short, otherwise one per line with multiline values indented relative to their attribute - comments before, after and inside of tags, on and between their attributes, and before their closing tag are kept, as are blank lines between sibling tags - attributes that have comments are always put on their own lines so that the output is the same on every pass
staging-devin-ai-integration
Bot
force-pushed
the
devin/1785764450-jsx-autofmt
branch
from
October 3, 2026 15:28
39afdd6 to
f1ed4f2
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Top of the stack #5883 → #5730 → this. Makes
dx fmt/autofmt keep rsx written in the JSX/XML tag syntax in that syntax instead of rewriting it into block syntax.write_element/write_componentdispatch to a newwrite_tagwhen the node'sNodeDelimiter(from #5730) is a tag. Mixed block/tag styles are preserved as written, since dispatch happens per node. Incomplete tags (which only parse with diagnostics) are not formatted.Layout:
<img src="image.png" /><h1>"Hello"</h1>>//>on its own line; multiline values (closures, longifchains) are indented relative to their attributename="literal"/name={expr}, shorthand collapses (disabled={disabled}→disabled), spreads as{..attrs}, dashed custom attributes unquoted (data-count="1"), and components without the turbofish (<Outlet<R>>)Comments and blank lines are located from the tag tokens and kept, using the comment helpers from #5883 (
write_comment_only_body,write_closing_line,has_leading_comments,inline_comment):Attributes that have comments are always put on their own lines, so the output is the same on every pass.
Comments in the middle of an open tag are kept too (second commit), mirroring what #5883 does for the block syntax. A comment after the tag name stays there, and one between
=and a value stays above the value:Comments inside an
ifattribute value and insidefor/ifheaders go through the code from #5883.Tests: idempotency samples (
tests/samples/jsx.rsx,tests/samples/jsx_comments.rsx) and normalization tests (tests/wrong/jsx-4sp*,tests/wrong/jsx-comments*).Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/99eedb36d44345dc8ce0f3ed5c460bd6
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/99eedb36d44345dc8ce0f3ed5c460bd6?variant=devin-insiders
Requested by: @nicoburns