The Embeddings options page allows you to customize or remove the predefined CodeRush Code Embeddings and create your own for any registered language. The options page is located at the Editor | Selections | Embeddings path inside the CodeRush Options Dialog. Here is what is looks like:
Read more…
The Embed Selection code provider allows you to wrap the selection into the predefined code blocks from the Code Embedding feature of CodeRush. The code provider is available when a whole line or multiple lines are selected and at least one embedding is predefined for the current language.
Read more…
CodeRush Code Embeddings allow you to wrap the selected code block or any text into another predefined code block, such as: try/catch, try/finally, using and lock statements, while and other loops, region directives, etc. Code Embeddings are available via the predefined keyboard shortcuts, via the Embed Selection code editor context menu item, or using the Embed Selection code provider.
Read more…
Here’s the list of advanced CodeRush coding helper features and code providers that do not generate or declare any code. For the code generation tools, see the corresponding topic.
Read more…
The Duplicate Line CodeRush feature intelligently creates a copy of an existing line of code, allowing you to easily modify it. If the code line is recognized as a predefined pattern, the line is copied and a portion of it is selected for further modification. Note that some code line bits can be modified automatically for you as well.
The predefined duplication patterns are configurable. They are stored and presented as regular expressions that contain one or several DXCore built-in reg-ex aliases for easy understanding. If the line doesn’t match any of the existing patterns – nothing happens, by default. However, there an option to copy-paste the entire line of the text if no matches are found when the feature is performed. All available options are listed later.
Read more…
Let’s talk about two similar features – the Smart Parentheses (also known as Smart Parens) and Smart Brackets. These two features allow you to easily type parens and brackets without having to close them with the corresponding closing paren or bracket, because they will be inserted automatically.
In this article the ‘paren’ means the opening or closing parenthesis ‘(‘ or ‘)’, and the bracket means the ‘[‘ (opening) and ‘]’ (closing) characters.
Read more…
Reorganization of the code is a great practice to improve code readability. If you prefer to sort your type members like this:
class {
private fields
constructors
public properties
public methods
private methods
}
or any other order, you can use the Member Organizer CodeRush plug-in for this purpose.
Read more…
If you heavily use region directives in CSharp, Visual Basic, or C++, the following CodeRush features may help you to make it easier to work with them:
Creating regions: