Skip to main content
A newer version of this page is available. .

Refactoring Assistance

  • 2 minutes to read

Refactorings are CodeRush features that enable you to automatically perform routine changes in your code.

CodeRush adds refactorings, code providers, and code formatters to Visual Studio's light bulb menu (Code Actions Menu). To invoke the Code Actions Menu, put the caret on the part of the code you need to change, press Ctrl + . or Ctrl + ~, and choose the required action from the invoked menu. When the cursor is on a Code Action Menu item, you can see a preview of the changes that will be made to your code.

Refactor_Main

Entries in the Code Actions Menu fall into the following categories:

  1. Code Formatters — do not change code behavior, but can improve code readability and layout to match a certain style. For instance, Sort Namespace References.
  2. Refactorings — do not change code behavior, but can simplify your code, improve readability, make code more flexible (for future changes), or bring the code to meet certain standards. For instance, Inline Method.
  3. Code Providerscan change code behavior or declare undeclared types and members. Use them to supplement your code with blocks which you might want to type manually. For instance, Create Event Trigger.

This section describes each Refactoring in detail. The description includes the purpose of the Refactoring, its availability and a usage example.