ReSharper provides three types of code templates:
- Live templates represent code fragments that can be quickly inserted into your code. The code of the template can be a short expression, a complete construct, or even an entire class or method. Each template is identified by a Shortcut - a short string of characters such as itar (abbreviation of "Iterate an array"), thr (for "throw new"), and so on. See Creating Source Code Using Live Templates for details.
- Surround templates let you quickly enclose an expression, a single statement or an arbitrary block of code with a predefined code construction, such as for loop, or while statement. See Surrounding Code Fragments with Templates for details.
- File templates are used to create new files with predefined code, such as a class or interface declaration, unit test, etc. See Creating Files from Templates for details.
Also, you can distinguish between:
- ReSharper's predefined code templates, that are included in the ReSharper installation and cover the most common cases for C#, VB.NET, ASP.NET, XML, HTML, Razor, CSS, JavaScript, and Resx code. To learn more, see the full list of Predefined Templates
- User-defined code templates that you can create, import, share and that can cover any particular aspect of your development practices. To learn more, see Creating and Editing Templates, Importing and Exporting Templates and Sharing Templates.
- Visual Studio code snippets that ReSharper automatically imports as live templates. To learn more, see Using Imported Code Snippets.
