All docs
V21.1
21.1
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

How to: Assign a Keyboard Shortcut to a Refactoring

CodeRush supports the ExecuteRefactoring command that runs a specific refactoring without invoking the Code Actions menu.

Follow the steps below to bind the “Ctrl+Shift+3” shortcut to the ExecuteRefactoring command:

  • Choose CodeRush | Shortcuts… from Visual Studio’s menu to open the Shortcuts configuration page.

    Config_Shortcuts_Access

  • Click New Shortcut to create a new shortcut.

    Config_Shortcuts_New

  • Specify the “Ctrl+Shift+3” shortcut in the “First shortcut” text box, and another shortcut in the “Second shortcut” text box (optional).

    First Shortcut

  • Choose ExecuteRefactoring from the “Command” combo box.

    Command

  • Type the name of a refactoring in the “Parameters” text box. In this example, the Extract String to Resource refactoring.

    Parameter

    You can find names of supported refactorings on the Editor | Language | Code Actions | Code Actions Catalog options page.

    Catalog

  • Click OK to apply the changes and close the Shortcuts options page.

  • Open the code editor and press the shortcuts key (“Ctrl+Shift+3” in this example) to run the ExecuteRefactoring command.

    Run