DioxusLabs / DioxusLabs/dioxus
`dx fmt` result looks minified for rsx tags started deep
- Dominant language
- Rust
- Stars
- 39.1k
- Forks
- 1.9k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 4
Description
**Problem**
When using `rsx!` tags deeper in the code (some 4-5 indentation blocks in), `dx fmt` makes some questionable choices in formatting.
It seems like above some indentation / line width, it gives up and just minifies the code like the IOCCC.

**Steps To Reproduce**
Steps to reproduce the behavior:
- have questionable coding practices
- start `rsx!` tag 5 indentations deep in a component
- put 3 indentations deep rsx code there, see pic below
- `dx fmt`
**Expected behavior**
Normal formatting
**Screenshots**
### Original

### After dx fmt

Notice how it's going over the original line length - so i don't think it's doing this out of reaching the line width limit.
### Sample code
```rs
#[component]
pub fn CollectionsAdminListPage() -> Element {
rsx! {
HtmlTable {
data: collections,
title: "Collections",
make_header: move || {
vec![
rsx!("Collection Name"),
rsx!("Collection Title"),
rsx!("Collection Description"),
rsx!("Time Created"),
rsx!("Time Modified"),
rsx!("Actions"),
]
},
make_row: move |c: CollectionUiRow| {
vec![
rsx! {
Link { to : Route::CollectionAdminDetailsPage { collection_id : c
.collection_id.clone() }, "{c.collection_id}" }
},
rsx!("{c.collection_title}"),
rsx!("{c.collection_description}"),
rsx!("{c.time_created}"),
rsx!("{c.time_modified}"),
rsx! {
div { role: "group",
button { "OPEN" }
button {
class: "secondary",
onclick: move |_| {
let c2 = c.clone();
async move {
let _ = drop_collection(c2).await;
do_refresh.call(());
}
},
"DROP"
}
}
},
]
},
}
}
}
```
**Environment:**
- Dioxus version: dioxus 0.6.1 (c2952a7) from binstall
- Rust version: 1.84-nightly
- OS info: linux
- App platform: -
**Questionnaire**
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.