-
Notifications
You must be signed in to change notification settings - Fork 861
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
Dioxius macros confuse rustfmt #6230
Comments
@uzytkownik what version of rustfmt are you using? I'm unable to reproduce the issue locally building rustfmt from source. |
@ytmimi Hmm. It looks something very strange goes on with tabs. It looks like rustfmt does not convert them into spaces which seems to be strange. I would expect based on documentation to have them converted into spaces by default- hard_tabs. Outside of that it seems to be mismatch of tab_spaces between rustfmt and editor. I disabled tabs in editor fixing the problem but it seems to me that behaviour should be clarified in documentation or (even better) |
Also, which configuration options are you using? |
@ytmimi None. I just run |
Got it, so this was just a mismatch between rustfmt and your editors settings? |
@ytmimi Sorry. As proximate cause (which was confusing for me) yes. Though I assumed by default |
I'm not sure if the issue is with rustfmt. I ran a little test, and it seems that when Given the following input that uses tabs: fn Layout() -> Element {
fn Links() -> Element {
rsx! {
nav {
ul {
id: "main-nav",
class: "nav nav-pills",
for item in RouteDiscriminants::iter() {
MenuItem { item }
}
}
}
}
}
rsx! {
header {
class: "text-bg-dark d-flex justify-content-center py-3",
Links {}
}
main {
class: "col-lg-8 mx-auto p-4 py-md-5",
Outlet::<Route> { }
}
}
} Running rustfmt with fn Layout() -> Element {
fn Links() -> Element {
rsx! {
nav {
ul {
id: "main-nav",
class: "nav nav-pills",
for item in RouteDiscriminants::iter() {
MenuItem { item }
}
}
}
}
}
rsx! {
header {
class: "text-bg-dark d-flex justify-content-center py-3",
Links {}
}
main {
class: "col-lg-8 mx-auto p-4 py-md-5",
Outlet::<Route> { }
}
}
} |
Let me know if you're able to recreate the scenario (and provide sample input) that lead to the odd indentation you noted in your original comment |
Rustfmt formats:
into:
The text was updated successfully, but these errors were encountered: