ReSharper 2021.2 Help

Predefined Live Templates

ReSharper | Tools | Templates Explorer | Live Templates

This topic lists all predefined Live templates in ReSharper 2021.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

TemplateDescription
C#
copyrightNUnit Copyright
something
ctxCurrent file context
nguidInsert new GUID
joinJoin clause in language integrated query
fromLanguage-Integrated Query
foreachforeach block
itliIterate a IList<T>
itarIterate an array
ritarIterate an array in inverse order
forSimple "for" loop
sfcSafely cast variable
psvmThe "Main" method declaration
outvPrint value of a variable
outPrint a string
asrtMake an assertion
asrtnAssert expression not null
thrthrow new
pcipublic const int
pcspublic const string
psrpublic static readonly
propProperty
earCreate an empty array
#if
#region
enum
elseelse statement
~Destructor
ctorConstructor
cwConsole.WriteLine
class
Exception
struct
forrReverse 'for' loop
namespace
interface
sim'int Main' method
indexer
svm'void Main' method
unsafeunsafe statement
uncheckedunchecked block
tryftry finally
trytry catch
switchswitch statement
whilewhile loop
iteratorsimple iterator
propgProperty with a 'get' accessor and a private 'set' accessor
AttributeAttribute using recommended pattern
dodo...while loop
checkedchecked block
ifif statement
locklock statement
mboxMessageBox.Show
usingusing statement
halASP.NET MVC Html.ActionLink
uaASP.NET MVC Url.Action
rtaASP.NET Controller RedirectToAction
attachedPropertyAttached property
dependencyPropertyDependency property
Global
ctxCurrent file context
nguidInsert new GUID
C++
ctxCurrent file context
nguidInsert new GUID
unionunion declaration
wcoutWrite to standard output stream
wclogWrite to standard log stream
cctorCopy constructor declaration with body
wcinRead from standard input stream
ctorDefault constructor declaration with body
UCLASSUCLASS declaration
UENUMCLASSUENUM declaration using the "enum class" syntax
UENUMUENUM declaration
mctorMove constructor declaration with body
vdtorVirtual destructor declaration with body
enum_to_stringFunction 'to_string' for enum
USTRUCTUSTRUCT declaration
dtorDestructor declaration with body
enumclassEnum class declaration
forrReversed for
clogWrite to standard log stream
docDocumentation template
foreachrange-based for loop
wcerrWrite to standard error stream
cerrWrite to standard error stream
cinRead from standard input stream
classClass declaration
coutWrite to standard output stream
dodo while loop
enumEnum declaration
forifor loop pattern with integer index
ifif statement
incgInclude guard
mainmain declaration
namespacenamespace declaration
structstruct declaration
switchswitch statement
trytry catch statement
whilewhile statement
VB.NET
ctxCurrent file context
nguidInsert new GUID
foreachFor Each block
itarIterate an array
itliIterate generic System.Collections.Generic.IList(Of T)
forSimple "For" loop
ritarIterate array in reverse order
DimDeclare a variable
asrtMake an assertion
outPrint a string
outvPrint value of an expression
pssmPublic Shared Sub Main
sfcSafely cast a variable
subSubroutine declaration
funFunction declaration
dcDirectCast clause
tcTryCast clause
ctCType clause
ByRefByRef parameter
ByValByVal parameter
selSelect case statement
attachedPropertyAttached property
dependencyPropertyDependency property
XML
ctxCurrent file context
nguidInsert new GUID
tCreate tag
tcCreate closed tag
aCreate tag attribute
HTML-Like
ctxCurrent file context
nguidInsert new GUID
<scriptCreate script tag
aCreate tag attribute
HTML
ctxCurrent file context
nguidInsert new GUID
<scriptCreate script tag
tCreate tag
tcCreate closed tag
aCreate tag attribute
Razor
ctxCurrent file context
nguidInsert new GUID
<scriptCreate script tag
tCreate tag
tcCreate closed tag
aCreate tag attribute
@inheritsRazor inherits directive
@modelRazor model directive
@sectionRazor section
ASP.NET
ctxCurrent file context
nguidInsert new GUID
<scriptCreate script tag
tCreate ASP.NET tag
tcCreate closed tag
aCreate tag attribute
<asp:HyperLinkASP.NET Hyperlink
foreachforeach block
Angular 2 HTML
ctxCurrent file context
nguidInsert new GUID
<scriptCreate script tag
aCreate tag attribute
ngClass
ngFor
ngIf
ngModel
ngRouterLink
ngStyle
JavaScript
ctxCurrent file context
nguidInsert new GUID
dodo...while loop
dwwriteln function call
elseelse statement
forfor loop
forinfor...in loop
forrreverse for loop
fun Create JavaScript function
function
ifif statement
whilewhile loop
withwith statement
switchswitch statement
trytry catch statement
itar Iterate an array
generatorgenerator
foroffor-of loop
CSS
ctxCurrent file context
nguidInsert new GUID
TypeScript
ctxCurrent file context
nguidInsert new GUID
dodo...while loop
dwwriteln function call
elseelse statement
forfor loop
forinfor...in loop
forrreverse for loop
fun Create TypeScript function
function
ifif statement
whilewhile loop
withwith statement
switchswitch statement
trytry catch statement
itar Iterate an array
foroffor-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
ctxCurrent file context
nguidInsert new GUID
dCreate resource entry
Last modified: 23 September 2021