ReSharper | Templates Explorer | Surround Templates | C#
This topic lists all predefined surround templates for C# in ReSharper 2024.3. For more information about surround templates, refer to Surround code fragments with templates.
Template
Details
()
Surround the selection with parentheses
Scope C# 2.0+, C/C++ expressions
Body
($SELECTION$$END$)
Parameters
SELECTION - The text selected by the user before invoking the template.
END - The caret position after the template is applied.
Before expansion
After expansion
{}
Surround the selection with braces
Scope C# 2.0+, C/C++ statements
Body
{
$SELECTION$$END$
}
Parameters
SELECTION - The text selected by the user before invoking the template.
END - The caret position after the template is applied.
Before expansion
After expansion
foreach
foreach block
Scope C# 2.0+ statements
Body
foreach($TYPE$ $VARIABLE$ in $COLLECTION$){
$SELECTION$$END$
}
Parameters
COLLECTION - Shows basic code completion list at the point where the variable is evaluated
TYPE - Suggests a type for a new variable declared in the template
VARIABLE - When executed in a variable declaration (where variable name should stand), suggests a name for the variable
SELECTION - The text selected by the user before invoking the template.
END - The caret position after the template is applied.