Templates

The Templates options page contains Code Templates options.

opTemplates

The templates tree in the left part of the options page lists CodeRush templates grouped into multiple categories and subcategories. Use the buttons over the tree view to create or remove categories and templates. You can also move the items within the tree.

The template search engine enables you to quickly find the desired template. Just type the character sequence contained in a template, to open a template containing these characters. Use the following buttons to move to the next search result:

  • TemplatesSearch - opens the next template whose key contains the specified characters.
  • TemplatesSearchText - opens the next template whose expansion contains the specified characters.

The options of the selected tree view item are shown to the right of the tree view, and are dependent on the item type selected (category or template):

Category options

TemplatesCategoryOptions

The following options are available for a templates category:

Option Description
Comment Specifies a comment to the selected category.
Action Hint Specifies the action hint shown when a template contained in the selected category is expanded. You can also specify the action hint color.
Templates Lists the templates contained in the selected category, excluding subcategories.

Template options

TemplatesTemplateOptions

The following options are available for a template:

Option Description
Comment Specifies a comment to the selected template.
Expansion Specifies the template expansion. Besides custom text, expansions may include aliases, text commands, and string providers. You can add them via the context menu. The buttons over the field provide quick access to general text commands (Caret, BlockAnchor, Marker) and string providers (Paste).
Auto double equals ("==") If this option is on, the template doubles the "=" sign, provided that this sign is the first sign of the expansion, and the template is expanded at the right part of an equality checking statement.
Suppress last character if present in code Suppresses the last character if the same character follows the template in the code.
Auto line terminator Adds the line terminator (semicolon in C) to the end of the expansion.
Multi-file template Turn this option on, if your template affects several files.
Suppress formatting Disables Visual Studio formatting for the selected template.
Use Context in which the template is available.
Trigger this template with Specifies the key used to activate the template. The available values are Space, Shift+Space, Enter.
Dependent namespaces Lists namespaces that should be added to the using section, when the template is activated, provided that they are not already added.
Note

The Command combo box enables you to quickly choose the desired text command.

TemplatesExpansionControls