ReSharper enables you to create classes, interfaces, structs and other files based on file templates. Once created, a new file is added to your project and opens in the editor. The file contains source code specified in the template.
Note
File templates use indentation defined by
language-specific code style settings that you can configure in:
ReSharper | Options | Code Editing | [Language] | Formatting Style.
- On the main menu, choose ReSharper | Edit | New from Template.
- In the New from Template sub-menu, choose Class, Interface, Struct, etc. or a custom item (if available) in the quick access list. If you want to use a custom file template that was not added to the quick access list, select More.
- If you have chosen More the Choose Template dialog box appears, where you can select a required template. To optionally introduce a custom file template into the quick access list, select its entry in the Choose Template dialog box and select Add to quicklist in the lower part of the dialog box before clicking OK.
- In the Create: [name of template] dialog box that appears, specify the name for the new file and click OK.
-
If the template is parameterized
(i.e. requires user input), the editor switches to the template editing mode and suggests an input position
for the first parameter.
You can type an appropriate value, choose one of the suggested values, if any,
or accept the default value suggested by ReSharper, and press:
- Tab or Enter to move to the input position of the next parameter.
- Shift+Tab to move the input focus to the previous input position.
- Esc to switch off the template editing mode and move the caret to the end position defined by template developer. In this case, all parameters will be initialized with default values.
The next two procedures are similar to the one described above; they differ only in the way you invoke the quick acess list for file templates.
- In the Solution Explorer, select a node where you want to create a new file from template.
- Press Alt+Insert or Ctrl+Alt+Insert to display a drop-down list of available file templates.
- Select a target template.
- Specify the name for the new file and click OK.
- Press Ctrl+Alt+Insert to display drop-down list of available file templates.
- Select a target template.
- Specify the name for the new file and click OK.

