ReSharper Help  

Safe Delete

The Safe Delete refactoring allows you to safely delete a symbol if no occurrences of it are found in the solution. ReSharperperforms the necessary verifications and validations to make sure the symbol can indeed be deleted without altering the code. The symbol can be a type, a method parameter or a type member.

In addition, if you are really determined to remove a symbol even though it is used in the code, ReSharper provides you with the full list of usages of the symbol. You can visit each usage and see if you want to delete it. As soon as the conflicts are resolved, you can apply the refactoring safely.

To safely delete a symbol

  1. In the editor, place the caret at the name of the symbol to be deleted.
  2. Do one of the following:
    • On the main menu, click ReSharper | Refactor | Safe Delete.
    • Right-click the method name and select Refactor | Safe Delete in the context menu.
    • Press Alt + Delete.
    • Press Ctrl + Shift + R, and then select Safe Delete.

    The Safe Delete dialog box opens.

If no conflicts are found, the symbol is deleted immediately.

See Also

Refactoring Code