ReSharper Web Help

To navigate between code templates in the Templates Explorer, you can use Template Scopes. Additionally, to make navigation more comfortable, any code template can be assigned to one or more categories. For example, if you have custom templates for unit tests, it could be convenient to create a Unit Tests category and assign them to it. Later you can select this category and find all your unit tests. Categories work as tags, and some of the predefined code templates are already assigned to categories (e.g. Iteration).

To assign a code template to a category
  1. On the main menu, choose ReSharper | Templates Explorer or press Alt+R+P.
  2. Select one of three tabs to choose code templates that you want to organize: Live Templates, Surround Templates, or File Templates.
  3. Optionally, choose a settings layer in the Layer drop-down list. Note that then you will be able only to organize code templates saved in this layer. For more information on settings layers, see Managing and Sharing Options.
  4. Select a template that you want to assign to a new category. Note that categories work as tags and you need to have at least one template in a category.
  5. Click New Category on the toolbar.
  6. In the Create Category dialog box that appears, specify a name for a new category and click OK.
To delete a code template
  1. On the main menu, choose ReSharper | Templates Explorer or press Alt+R+P.
  2. Click one of three tabs corresponding to the required type of template: Live Templates, Surround Templates, or File Templates.
  3. If you need to delete a template from a particular settings layer, choose this layer in the Layer drop-down list.
  4. Find a template to be removed and select it.
  5. Click Delete on the toolbar.

All live templates are enabled by default, i.e. you can apply them in your code. If necessary, you can temporarily disable some templates so that they are not appear in the list of suggested templates when you wan to apply a live template.

To disable or enable live templates
  1. On the main menu, choose ReSharper | Templates Explorer or press Alt+R+P.
  2. Click on the Live Templates tab.
  3. If you need to disable or enable templates from a particular settings layer, choose this layer in the Layer drop-down list.
  4. Find templates to be enabled or disabled and use check boxes next to template names to switch their state.

 Tip

For file templates and surround templates you can also organize the way they appear in the quick access list.

See Also

Concepts

Procedures

Reference