Predefined surround templates
This topic lists all predefined surround templates in ReSharper 2025.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, for example foreach — that you can type right in the editor to invoke the template.
Index of Surround Templates
Template | Description |
|---|---|
C# | |
Unity Profiler Begin/End Sample Block | |
Surround the selection with parentheses | |
Surround the selection with braces | |
foreach block | |
Simple "for" loop | |
Surround the selection with a region | |
Add a namespace to the selected code | |
try finally | |
try catch | |
while loop | |
do...while loop | |
if statement | |
lock statement | |
using statement | |
Cast the selection to a specific type | |
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 | |
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 | |
C/C++ | |
Anonymous namespace | |
Reverse for loop | |
Write to standard error stream | |
do while loop | |
Range-based for loop | |
For loop with integer index | |
if statement | |
Namespace declaration | |
try catch statement | |
while statement | |
static_cast expression | |
dynamic_cast expression | |
const_cast expression | |
reinterpret_cast expression | |
C-like cast expression | |
Include guard surround template | |
if else statement | |
C++ | |
Include guard surround template | |