Friday, September 23, 2011

Resharper's Type Member Layout

I've just started using the Type Member Layout feature in Resharper, it wasn't new in Resharper 6, but I haven'd noticed it util recently. I've found Regionerate a handy tool to ensure that members in a class are sorted in a predictable order that isn't open to interpretation like sorting by flow or logical grouping. I've never been a fan of regions for that same reason, what to put in a region is largely a matter of opinion, and can make code less discoverable. But, my biggest bugbear with Regionerate is the double spacing it leaves between members despite countless hours fiddling with its config xml.

Resharper's Type Member Layout is, well, sharper.
I spent some time finding and fine tuning a 100% StyleCop compliant format here's the xml configuration for it.
The Type Member Layout configuration is actually included in the main Resharper xml configuration.