Open
Description
Hello,
I haven't been able to find this in the issue tracker. If it is there, sorry for missing it!
On IRC, someone wanted to auto-format a big match-like macro, like:
match_any_type!(var, {
Foo::A => a,
Foo::B => {
bar();
b
}
// etc.
})
The use case appears to make sense to me, but I don't think any rust formatting tool is currently able to handle this, as it is completely macro-dependent.
However, @thepowersgang proposed a solution:
Mutabah | [snip] Re getting auto-formatting of macro input - I don't know if there's formatting tools that can do that... a
| powerful one could possibly look at the macro signature and guess at formatting for fragements
IOW, rustfmt could (theoretically) check the macro signature and figure out what parts are of what type, to then try to indent them correctly.
I don't know if this is actually doable within reasonable complexity, but thought this idea was great and deserved to be tracked :)
Anyway, thank you for your work on rustfmt!