Code Cleanup lets you remove a number of code redundancies automatically, instead of navigating between code issues and removing them with quick-fixes.
- Choose ReSharper | Options in the main menu.
- Open Code Editing | Code Cleanup options page.
- Create a new profile as described in Creating Custom Profiles. In the Selected profile settings for the new profile, select Remove code redundancies.
-
Click
Save
to apply the modifications and let ReSharper choose the settings layer,
or choose a particular settings layer in the
Save To drop-down list.
To learn more about saving ReSharper settings, see
JetBrains .NET Tools Blog: Save or Save To in ReSharper Options
.
- Choose ReSharper | Tools | Cleanup Code in the menu to open the Code Cleanup dialog box for the current file or for a solution node (see Running Code Cleanup for details), and then select the newly created profile in the Available Profiles area.
- Click Run to perform Code Cleanup. ReSharper will remove all redundancies in the current file of in the selected solution node and according to the cleanup profile settings.
