ReSharper 2024.3 Help

General

ReSharper options: Code Editing | Code Cleanup | General

This page of ReSharper options allows you to configure general preferences of code cleanup.

Save after cleanup is applied to the whole file

This option defines whether to automatically save changes after you run code cleanup in files that are currently opened in the editor.

If you run cleanup in a selected code block in a file, the file will not be saved automatically regardless of this option.

Automatically run cleanup when saving a file

You can run any Code Cleanup tasks, for example, reformat code every time you save changes in a file to make sure that your edits always comply with your code style.

Select this option to do so.

Optionally, you can restrict automatic cleanup to specific files by a file mask.

You can also select Only changed parts of file to make sure that cleanup is applied to the code affected by your changes, and the rest of the code in the file is not modified.

If you choose to clean up only the changed parts of files, you can fine-tune this behavior with the following options:

  • Perform full cleanup if partial cleanup is not possible — depending on this option, ReSharper will either clean up the whole file or skip the file if it is not possible to restrict the cleanup to the modified parts of the file.

  • Allow cleanup on save for shared files — use this option to enable or disable partial cleanup in files that are included in the solution several times, such as files from shared projects.

Cleanup for recently modified files

Consider files recently modified if changed during the last [ x ] days

Use this selector to define what is considered recently modified when you run code cleanup in recently modified files.

Only in changed parts of the file

Select this checkbox to make sure that cleanup is applied to the code affected by your changes, and the rest of the code in the file is not modified.

Last modified: 11 February 2024