Predefined Surround Templates
This section lists all predefined Surround templates in ReSharper 2018.3.
Live/Surround templates can be used for generating code in existing files and (if there is the $SELECTION$
parameter in the template body) for surrounding code fragments with template code, such as try...catch
statement.
Each live template is identified by a Shortcut — a short string of characters, e.g. foreach — that you can type right in the editor to invoke the template.
Index of Surround Templates
Template | Description |
---|---|
C++ | |
Surround the selection with parentheses | |
Surround the selection with braces | |
Reversed 'for' | |
'range-based for' loop | |
do-while loop | |
'for' loop pattern with integer index | |
'if' statement | |
Code snippet for try...catch statement | |
'while' statement | |
Surround the selected expression with | |
Surround selected declarations with | |
Surround the selected expression with | |
Add a namespace to the selected code | |
Code snippet for #if...#endif preprocessor directive | |
Surround the selected expression with | |
Surround the selected expression with | |
Cast the selection to a specific type | |
namespace ... | |
Add a class to the selected code | |
Surround selection with an include guard | |
Put the selection into an | |
C# | |
Surround the selection with parentheses | |
Surround the selection with braces | |
foreach block | |
Simple "for" loop | |
#if (Imported Visual C# Snippets) | |
#region (Imported Visual C# Snippets) | Surround the selection with a region |
namespace (Imported Visual C# Snippets) | Add a namespace to the selected code |
tryf (Imported Visual C# Snippets) | try finally |
try (Imported Visual C# Snippets) | try catch |
while (Imported Visual C# Snippets) | while loop |
do (Imported Visual C# Snippets) | do...while loop |
if (Imported Visual C# Snippets) | if statement |
lock (Imported Visual C# Snippets) | lock statement |
using (Imported Visual C# Snippets) | using statement |
Cast the selection to a specific type | |
XML | |
JavaScript | |
Surround the selection with braces | |
Surround the selection with parentheses | |
TypeScript | |
Surround the selection with braces | |
Surround the selection with parentheses | |
ASP.NET | |
Wrap the selection in a hyperlink | |
HTML | |
Wrap the selection in a hyperlink | |
Razor | |
Wrap the selection in a hyperlink | |
HTML-Like | |
Wrap the selection in a hyperlink | |
Angular 2 HTML | |
ASP.NET(C#) | |
foreach block | |
ASP.NET(VB.NET) | |
For Each block | |
VB.NET | |
Put the selection into the statement block following | |
Put the selection into the statement block following | |
Transform the selection into the | |
Put the selection into the | |
Wrap the selection into the | |
Transform the selection into the first parameter of the | |
Transform the selection into the first parameter of the | |
Add a namespace to the selected code |