Predefined live templates
This topic lists all predefined live templates in ReSharper 2024.1.
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 Live Templates
Template | Description |
---|---|
Global | |
Current file context | |
Insert new GUID | |
C# | |
Current file context | |
Insert new GUID | |
Join clause in language integrated query | |
Language-Integrated Query | |
foreach block | |
Iterate a IList<T> | |
Iterate an array | |
Iterate an array in inverse order | |
Simple "for" loop | |
Safely cast variable | |
The "Main" method declaration | |
Print value of a variable | |
Print a string | |
Make an assertion | |
Assert expression not null | |
throw new | |
public const int | |
public const string | |
public static readonly | |
Property | |
Create an empty array | |
else statement | |
Destructor | |
Constructor | |
Console.WriteLine | |
Reverse 'for' loop | |
'int Main' method | |
'void Main' method | |
unsafe statement | |
unchecked block | |
try finally | |
try catch | |
switch statement | |
while loop | |
simple iterator | |
Property with a 'get' accessor and a private 'set' accessor | |
Attribute using recommended pattern | |
do...while loop | |
checked block | |
if statement | |
lock statement | |
MessageBox.Show | |
using statement | |
ASP.NET MVC Html.ActionLink | |
ASP.NET MVC Url.Action | |
ASP.NET Controller RedirectToAction | |
Attached property | |
Dependency property | |
DOTS Baker | |
DOTS IComponentData | |
DOTS IJob Entity | |
C++ | |
Current file context | |
Insert new GUID | |
union declaration | |
Write to standard output stream | |
Write to standard log stream | |
Copy constructor declaration with body | |
UINTERFACE declaration | |
Read from standard input stream | |
Default constructor declaration with body | |
UCLASS declaration | |
UENUM declaration using the "enum class" syntax | |
UENUM declaration | |
Move constructor declaration with body | |
else statement | |
Virtual destructor declaration with body | |
Function 'to_string' for enum | |
USTRUCT declaration | |
Destructor declaration with body | |
Enum class declaration | |
Reversed for | |
Write to standard log stream | |
Documentation template | |
Write to standard error stream | |
Write to standard error stream | |
Read from standard input stream | |
Class declaration | |
Write to standard output stream | |
do while loop | |
Enum declaration | |
range-based for loop | |
for loop pattern with integer index | |
if statement | |
Include guard | |
main declaration | |
namespace declaration | |
struct declaration | |
switch statement | |
try catch statement | |
while statement | |
VB.NET | |
Current file context | |
Insert new GUID | |
For Each block | |
Iterate an array | |
Iterate generic System.Collections.Generic.IList(Of T) | |
Simple "For" loop | |
Iterate array in reverse order | |
Declare a variable | |
Make an assertion | |
Print a string | |
Print value of an expression | |
Public Shared Sub Main | |
Safely cast a variable | |
Subroutine declaration | |
Function declaration | |
DirectCast clause | |
TryCast clause | |
CType clause | |
ByRef parameter | |
ByVal parameter | |
Select case statement | |
Attached property | |
Dependency property | |
XML | |
Current file context | |
Insert new GUID | |
Create tag | |
Create closed tag | |
Create tag attribute | |
HTML-Like | |
Current file context | |
Insert new GUID | |
Create script tag | |
Create tag attribute | |
HTML | |
Current file context | |
Insert new GUID | |
Create script tag | |
Create tag | |
Create closed tag | |
Create tag attribute | |
Razor | |
Current file context | |
Insert new GUID | |
Create script tag | |
Create tag | |
Create closed tag | |
Create tag attribute | |
Razor inherits directive | |
Razor model directive | |
Razor section | |
ASP.NET | |
Current file context | |
Insert new GUID | |
Create script tag | |
Create ASP.NET tag | |
Create closed tag | |
Create tag attribute | |
ASP.NET Hyperlink | |
foreach block | |
Angular 2 HTML | |
Current file context | |
Insert new GUID | |
Create script tag | |
Create tag attribute | |
JavaScript | |
Current file context | |
Insert new GUID | |
do...while loop | |
writeln function call | |
else statement | |
for loop | |
for...in loop | |
reverse for loop | |
Create JavaScript function | |
if statement | |
while loop | |
with statement | |
switch statement | |
try catch statement | |
Iterate an array | |
generator | |
for-of loop | |
CSS | |
Current file context | |
Insert new GUID | |
TypeScript | |
Current file context | |
Insert new GUID | |
do...while loop | |
writeln function call | |
else statement | |
for loop | |
for...in loop | |
reverse for loop | |
Create TypeScript function | |
if statement | |
while loop | |
with statement | |
switch statement | |
try catch statement | |
Iterate an array | |
for-of loop | |
Code snippet for default constructor declaration with body | |
Code snippet for class | |
Code snippet for module | |
Code snippet for interface | |
Code snippet for enum | |
Code snippet for number indexer annotation | |
Code snippet for string indexer annotation | |
Code snippet for property | |
Resx | |
Current file context | |
Insert new GUID | |
Create resource entry | |
Unity | |
Current file context | |
Insert new GUID | |
Unity CreateAssetMenu attribute | |
Unity log warning | |
Unity log exception | |
Unity menu item handler | |
Unity serialized field | |
Unity log error | |
Unity log object/message | |
Unity RequireComponent attribute | |
Unity property with serialized backing field | |
Unity coroutine method | |
Unity log variable | |
ShaderLab Integer property | |
ShaderLab Blend 2x multiplicative (srcdst+dstsrc) | |
ShaderLab Float property | |
ShaderLab Surface Shader | |
ShaderLab Shader block | |
ShaderLab 3D property | |
ShaderLab Vector property | |
ShaderLab Blend soft additive (src*(1-dst)+dst) | |
ShaderLab Blend additive (src + dst) | |
ShaderLab Vertex/Fragment Shader | |
ShaderLab 2D property | |
ShaderLab Blend traditional transparency (src*srcAlpha+(1-srcAlpha)*dst) | |
ShaderLab CubeArray property | |
ShaderLab Blend multiplicative (src*dst) | |
ShaderLab Cube property | |
ShaderLab 2DArray property | |
ShaderLab Color property | |
ShaderLab Blend premultiplied transparency (src+(1-srcAlpha)*dst) | |
ShaderLab Vertex/Fragment Shader Pass |