Sort class properties alphabetically

I am trying to sort properties of a class alphabetically.

I have found that I can do it using Code Cleanup and it works but it also applies a lot of other rules that in some cases I don't need.

Is there any way to do only sorting of a properties in a class without using the Code cleanup? Some kind of custom command maybe?

 

Thanks

0
2 comments

Hello,

 

Sorting of class properties can be performed only by Code Cleanup. I'd suggest creating a new Code Cleanup profile, disable everything except "Apply file layout" option and use this profile by default for sorting. Please refer to the following help article for more details - https://www.jetbrains.com/help/resharper/Code_Cleanup__Index.html

Please let me know if you have any questions.

Thank you.

0

Thanks for your reply.

I have done what you suggested but how do I specify custom settings. e.g Property attribute should not be on the same line as the property

0

Please sign in to leave a comment.