I use ReSharper's code cleanup all the time, but sometimes I have code formatted in a way that makes it easier to read than ReSharper's formatter makes it. Is there a way to mark part of your file with comments or something to make it skip formatting that portion.
(I'm not talking about inspections, I know how to have ReSharper ignore regions for inspections)
Press Ctrl+Alt+Enter or choose ReSharper | Edit | Reformat Code from the main menu . Alternatively, you can press Ctrl+Shift+A , start typing the command name in the popup, and then choose it there.
Select ReSharper | Options from the main menu or press Alt+R O . Go to the cleanup profiles settings page: Code Editing | Code Cleanup | Profiles. Select which Code Cleanup profile should be applied on save and click Set as default (the default profile is also used for silent cleanup).
In Visual Studio Code, press Control + Shift + P or Command + Shift + P (Mac) to open the command palette and type save and then select the Save without Formatting option.
Right-click on the project or solution name in Solution Explorer, select Analyze and Code Cleanup, and then select Run Code Cleanup.
I had a discussion with Resharper support about this, their answer:
Thank you very much for this information! We will discuss if we can support such formatting style in one of the future versions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With