Files
dioxus/packages/autofmt
Sebastian Flügge 82c3cab25f fix(autofmt): preserve indentation of commented-out RSX blocks (#5464)
* test: add failing idempotency tests for commented-out RSX blocks

Two variants of the regression introduced in v0.7.4 (#5257):
- commented_rsx_block: first line keeps indent, rest gets dedented
- commented_rsx_block_nested: entire block gets dedented

See #5463

* fix(autofmt): preserve indentation of commented-out RSX blocks

Trailing comments before `}` in write_rsx_block were indented at
parent level instead of child level. Truncate the tab from
tabbed_line() and bump indent to child level before
apply_line_comments, same approach as write_trailing_body_comments.

Fixes #5463
2026-04-21 17:16:20 -07:00
..
2025-10-30 21:26:01 -07:00

dioxus-autofmt

Crates.io MIT licensed Build Status Discord chat

Website | Guides | API Docs | Chat

Overview

dioxus-autofmt provides a pretty printer for the rsx syntax tree.

This is done manually with a via set of formatting rules. The output is not guaranteed to be stable between minor versions of the crate as we might tweak the output.

dioxus-autofmt provides an API to perform precision edits as well as just spit out a block of formatted RSX from any RSX syntax tree. This is used by the rsx-rosetta crate which can accept various input languages and output valid RSX.

Contributing

  • Report issues on our issue tracker.
  • Join the discord and ask questions!

License

This project is licensed under the MIT license.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Dioxus by you shall be licensed as MIT without any additional terms or conditions.