Open lancecarlson opened 8 years ago
I've had a lot of trouble with getting indentation to behave inside macros, I'd really like a setting that makes being inside a macro disable visual indentation.
Same problem here with Yew's html!
macro. As you can see if you try to indent the following code, the formatter tries to move the pseudo-HTML lines, messing them up even if correctly indented via a manual intervention:
use yew::prelude::*;
#[function_component]
fn App() -> Html {
html! {
<div>
<h1>{"Test code"}</h1>
<div>
<p>{"This is a test code to show the issue with indentation"}</p>
</div>
</div>
}
}
fn main() {
yew::Renderer::<App>::new().render();
}
It would be very nice to see a behaviour similar to rustfmt
, which completely ignores code inside procedural macros.
I'm playing around with nickel and was trying to do some simple example apps. I had an indentation issue after the middleware! macro. See comment below: