Embedding
- 3 minutes to read
CodeRush Classic enables you to quickly embed a selected code section into an appropriate block. You can use the Embed Selection code provider as well as the appropriate shortcut to apply a certain embedding.
The following embeddings are available.
Embedding | Shortcut | Description |
---|---|---|
try.. |
C | Embeds a selection into the try.. |
try.. |
F | Embeds a selection into the try.. |
try.. |
T | Embeds a selection into the try.. |
#region..#endregion | CTRL+3 | Embeds a selection between the #region and #endregion directives, and selects the created region name. |
#if..#endif | Can be accessed only from the Embed Selection code provider. | Embeds a selection between the #if and #endif directives, and places the cursor after the #if directive. |
while() | Can be accessed only from the Embed Selection code provider. | Embeds a selection into the while() code block, places the cursor into the conditional statement brackets, and drops a marker onto the initial selection. |
do.. |
Can be accessed only from the Embed Selection code provider. | Embeds a selection into the do.. |
using() | U | Embeds a selection into the using() code block, places the cursor into brackets, and drops a marker onto the initial selection. |
lock() | L | Embeds a selection into the lock() code block, places the cursor into brackets, and drops a marker onto the initial selection. |
block - { } | B, SHIFT+[ | Encloses a selection in braces and selects the whole generated block. |
Begin |
Can be accessed only from the Embed Selection code provider. | Embeds a selection between the Begin |
Wait |
W | Embeds a selection into the try.. |
Stop Watch | none | Creates a new instance of the System. |
To string | SHIFT+’ | Quotes a selected code section and selects the whole generated block. |
Comment box | Can be accessed only from the Embed Selection code provider. | Embeds a selection into the comment box and selects the whole generated block. |
Parentheses | SHIFT+9, SHIFT+0. Can be accessed only via shortcuts. | Embeds the selection into parentheses. |
Not Parentheses | SHIFT+1. Can be accessed only via a shortcut. | Embeds the selection into the parentheses and places the logical Not (! in C#/C++, Not in VB) before the parentheses. |
Note
All embeddings but the last two, are only available for a multi-line selection. The Parentheses and Not Parentheses embeddings are available for any selection.
You can customize existing embeddings and create new embeddings via the Embedding options page. To assign a shortcut to an embedding, use the Shortcuts options page.