[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
  System Requirements
  Improve Performance
 [Expand]Features by Language
 [Expand]Getting Started
 [Expand]How To
 [Collapse]Coding Assistance
  [Expand]Code Templates
  [Expand]Auto Completion
  [Expand]Clipboard Tools
  [Expand]Selection Tools
  [Collapse]Code Providers
   [Expand]Contract Providers
   [Expand]Declaration Providers
   [Expand]Implementation Providers
    Add Copyright Header
    Add Else Statement
    Add Getter/Setter
    Add Missing Constructors
    Add Parameter
    Add to Interface
    Add XML Comments
    Convert to Function
    Convert to Procedure
    Convert to Property With Change Notification/Introduce Change Notification
    Create Event Trigger
    Encapsulate Property
    Import Type/All Types (XAML)
    Introduce Format Item
    Introduce Setter Guard Clause
    Invert Selection
    Promote to Parameter
    XPO Fields
  [Expand]Declare Menu
  [Expand]Typing Helpers
 [Expand]Navigation and Search Tools
 [Expand]Static Code Analysis
 [Expand]Visualization Tools
 [Expand]Code Style Assistance
  Building Assistance
  Debugging Assistance
 [Expand]Refactoring Assistance
 [Expand]Unit Testing Assistance
 [Expand]Decompiling Tools
 [Expand]Configuration Options
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Code Providers

CodeRush ships with over 40 Code Providers that allow you to make routine changes in code and write code faster.

The topics in this section describe each Code Provider in detail. The description includes the purpose of the Code Provider, its availability and the "how to use" example.

Expanded How to Use

  1. Invoke the Code Actions Menu. Place the caret in the part of the code you want to change, and press Ctrl + . or Ctrl + ~.

    CodeRush adds code providers, refactorings, and Code Formatters to Visual Studio's light bulb menu (Code Actions Menu).

  2. Choose the action from the invoked menu. For example, Declare Field with Initializer.

    You can see a preview of the changes CodeRush can apply to your code.

  3. Press Enter to perform the action.

    The red target picker appears in Declaration Providers. This picker allows you to choose the place where the generated code can be inserted.

    You can configure which Declaration Provider should invoke the target picker in the Editor | All Languages | Code Actions | Target Picker options page.

  4. Use the Up Arrow and Down Arrow keys to move the target picker.

  5. Press Enter to generate code in the selected position. For example, the Declare Field with Initializer code provider adds the initialized field declaration to the current class and assigns the parameter value to it.

Is this topic helpful?​​​​​​​