ReSharper 2024.2 Help

Predefined live templates

ReSharper | Tools | Templates Explorer | Live Templates

This topic lists all predefined live templates in ReSharper 2024.2.

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

ctx

Current file context

nguid

Insert new GUID

C++

ctx

Current file context

nguid

Insert new GUID

union

union declaration

wcout

Write to standard output stream

wclog

Write to standard log stream

cctor

Copy constructor declaration with body

wcin

Read from standard input stream

ctor

Default constructor declaration with body

mctor

Move constructor declaration with body

else

else statement

vdtor

Virtual destructor declaration with body

enum_to_string

Function 'to_string' for enum

dtor

Destructor declaration with body

enumclass

Enum class declaration

forr

Reversed for

clog

Write to standard log stream

doc

Documentation template

wcerr

Write to standard error stream

cerr

Write to standard error stream

cin

Read from standard input stream

class

Class declaration

cout

Write to standard output stream

do

do while loop

enum

Enum declaration

foreach

range-based for loop

fori

for loop pattern with integer index

if

if statement

incg

Include guard

main

main declaration

namespace

namespace declaration

struct

struct declaration

switch

switch statement

try

try catch statement

while

while statement

UCLASS

UCLASS declaration

UENUM

UENUM declaration

UENUMCLASS

UENUM declaration using the "enum class" syntax

UINTERFACE

UINTERFACE declaration

USTRUCT

USTRUCT declaration

C#

ctx

Current file context

nguid

Insert new GUID

join

Join clause in language integrated query

from

Language-Integrated Query

foreach

foreach block

itli

Iterate a IList<T>

itar

Iterate an array

ritar

Iterate an array in inverse order

for

Simple "for" loop

sfc

Safely cast variable

psvm

The "Main" method declaration

outv

Print value of a variable

out

Print a string

asrt

Make an assertion

asrtn

Assert expression not null

thr

throw new

pci

public const int

pcs

public const string

psr

public static readonly

prop

Property

ear

Create an empty array

#if

#region

enum

else

else statement

~

Destructor

ctor

Constructor

cw

Console.WriteLine

class

Exception

struct

forr

Reverse 'for' loop

namespace

interface

sim

'int Main' method

indexer

svm

'void Main' method

unsafe

unsafe statement

unchecked

unchecked block

tryf

try finally

try

try catch

switch

switch statement

while

while loop

iterator

simple iterator

propg

Property with a 'get' accessor and a private 'set' accessor

Attribute

Attribute using recommended pattern

do

do...while loop

checked

checked block

if

if statement

lock

lock statement

mbox

MessageBox.Show

using

using statement

hal

ASP.NET MVC Html.ActionLink

ua

ASP.NET MVC Url.Action

rta

ASP.NET Controller RedirectToAction

attachedProperty

Attached property

dependencyProperty

Dependency property

test

baker

DOTS Baker

componentdata

DOTS IComponentData

jobentity

DOTS IJob Entity

C++

ctx

Current file context

nguid

Insert new GUID

union

union declaration

wcout

Write to standard output stream

wclog

Write to standard log stream

cctor

Copy constructor declaration with body

UINTERFACE

UINTERFACE declaration

wcin

Read from standard input stream

ctor

Default constructor declaration with body

UCLASS

UCLASS declaration

UENUMCLASS

UENUM declaration using the "enum class" syntax

UENUM

UENUM declaration

mctor

Move constructor declaration with body

else

else statement

vdtor

Virtual destructor declaration with body

enum_to_string

Function 'to_string' for enum

USTRUCT

USTRUCT declaration

dtor

Destructor declaration with body

enumclass

Enum class declaration

forr

Reversed for

clog

Write to standard log stream

doc

Documentation template

wcerr

Write to standard error stream

cerr

Write to standard error stream

cin

Read from standard input stream

class

Class declaration

cout

Write to standard output stream

do

do while loop

enum

Enum declaration

foreach

range-based for loop

fori

for loop pattern with integer index

if

if statement

incg

Include guard

main

main declaration

namespace

namespace declaration

struct

struct declaration

switch

switch statement

try

try catch statement

while

while statement

VB.NET

ctx

Current file context

nguid

Insert new GUID

foreach

For Each block

itar

Iterate an array

itli

Iterate generic System.Collections.Generic.IList(Of T)

for

Simple "For" loop

ritar

Iterate array in reverse order

Dim

Declare a variable

asrt

Make an assertion

out

Print a string

outv

Print value of an expression

pssm

Public Shared Sub Main

sfc

Safely cast a variable

sub

Subroutine declaration

fun

Function declaration

dc

DirectCast clause

tc

TryCast clause

ct

CType clause

ByRef

ByRef parameter

ByVal

ByVal parameter

sel

Select case statement

attachedProperty

Attached property

dependencyProperty

Dependency property

test

XML

ctx

Current file context

nguid

Insert new GUID

t

Create tag

tc

Create closed tag

a

Create tag attribute

HTML-Like

ctx

Current file context

nguid

Insert new GUID

<script

Create script tag

a

Create tag attribute

HTML

ctx

Current file context

nguid

Insert new GUID

<script

Create script tag

t

Create tag

tc

Create closed tag

a

Create tag attribute

Razor

ctx

Current file context

nguid

Insert new GUID

<script

Create script tag

t

Create tag

tc

Create closed tag

a

Create tag attribute

@inherits

Razor inherits directive

@model

Razor model directive

@section

Razor section

ASP.NET

ctx

Current file context

nguid

Insert new GUID

<script

Create script tag

t

Create ASP.NET tag

tc

Create closed tag

a

Create tag attribute

<asp:HyperLink

ASP.NET Hyperlink

foreach

foreach block

Angular 2 HTML

ctx

Current file context

nguid

Insert new GUID

<script

Create script tag

a

Create tag attribute

ngClass

ngFor

ngIf

ngModel

ngRouterLink

ngStyle

JavaScript

ctx

Current file context

nguid

Insert new GUID

do

do...while loop

dw

writeln function call

else

else statement

for

for loop

forin

for...in loop

forr

reverse for loop

fun

Create JavaScript function

function

if

if statement

while

while loop

with

with statement

switch

switch statement

try

try catch statement

itar

Iterate an array

generator

generator

forof

for-of loop

CSS

ctx

Current file context

nguid

Insert new GUID

TypeScript

ctx

Current file context

nguid

Insert new GUID

do

do...while loop

dw

writeln function call

else

else statement

for

for loop

forin

for...in loop

forr

reverse for loop

fun

Create TypeScript function

function

if

if statement

while

while loop

with

with statement

switch

switch statement

try

try catch statement

itar

Iterate an array

forof

for-of loop

ctor

Code snippet for default constructor declaration with body

class

Code snippet for class

module

Code snippet for module

interface

Code snippet for interface

enum

Code snippet for enum

nidx

Code snippet for number indexer annotation

sidx

Code snippet for string indexer annotation

prop

Code snippet for property

Resx

ctx

Current file context

nguid

Insert new GUID

d

Create resource entry

Unity

ctx

Current file context

nguid

Insert new GUID

assetmenu

Unity CreateAssetMenu attribute

logwarn

Unity log warning

logex

Unity log exception

menuitem

Unity menu item handler

sfield

Unity serialized field

logerr

Unity log error

log

Unity log object/message

reqcomp

Unity RequireComponent attribute

sprop

Unity property with serialized backing field

cor

Unity coroutine method

logvar

Unity log variable

int

ShaderLab Integer property

blendmultiplicative2x

ShaderLab Blend 2x multiplicative (srcdst+dstsrc)

float

ShaderLab Float property

surf

ShaderLab Surface Shader

shader

ShaderLab Shader block

tex3d

ShaderLab 3D property

vec

ShaderLab Vector property

blendadditivesoft

ShaderLab Blend soft additive (src*(1-dst)+dst)

blendadditive

ShaderLab Blend additive (src + dst)

vfshader

ShaderLab Vertex/Fragment Shader

tex2d

ShaderLab 2D property

blendtransparent

ShaderLab Blend traditional transparency (src*srcAlpha+(1-srcAlpha)*dst)

cubearr

ShaderLab CubeArray property

blendmultiplicative

ShaderLab Blend multiplicative (src*dst)

cube

ShaderLab Cube property

tex2darr

ShaderLab 2DArray property

color

ShaderLab Color property

blendtransparentpremul

ShaderLab Blend premultiplied transparency (src+(1-srcAlpha)*dst)

vfpass

ShaderLab Vertex/Fragment Shader Pass

Last modified: 18 August 2024