I want to move all the private fields in a class to the top or at least to a block where they are gathered together.
Is there any quick way to achieve this with ReSharper?
I want to move all the private fields in a class to the top or at least to a block where they are gathered together.
Is there any quick way to achieve this with ReSharper?
Have you tried the Clean code options?
I believe you can set the behaviour there.
Kindness,
Dan
I answered a similar question here. It's for putting them at the bottom, but should be enough information to get you set up too.
You want the feature called Cleanup Code.
You can access it via
Ensure that your profile has the option Reorder members selected. If you want to change the way that the reordering works, you can, but it's a little involved.
You can also apply this across an entire project or the entire solution by right-clicking at the appropriate level in solution explorer and choosing the Cleanup Code... option from there.