ReSharper 2017.3 Help

Predefined Live Templates

ReSharper | Tools | Templates Explorer | Live Templates

This section lists all predefined Live templates in ReSharper 2017.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, e.g. foreach — that you can type right in the editor to invoke the template.

Index of Live Templates

TemplateDescription
Global
ctx Current file context
nguid Insert new GUID
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 (Imported Visual C# Snippets)
#region (Imported Visual C# Snippets)
enum (Imported Visual C# Snippets)
else (Imported Visual C# Snippets)else statement
~ (Imported Visual C# Snippets)Destructor
ctor (Imported Visual C# Snippets)Constructor
cw (Imported Visual C# Snippets)Console.WriteLine
class (Imported Visual C# Snippets)
Exception (Imported Visual C# Snippets)
struct (Imported Visual C# Snippets)
forr (Imported Visual C# Snippets)Reverse 'for' loop
namespace (Imported Visual C# Snippets)
interface (Imported Visual C# Snippets)
sim (Imported Visual C# Snippets)'int Main' method
indexer (Imported Visual C# Snippets)
svm (Imported Visual C# Snippets)'void Main' method
unsafe (Imported Visual C# Snippets)unsafe statement
unchecked (Imported Visual C# Snippets)unchecked block
tryf (Imported Visual C# Snippets)try finally
try (Imported Visual C# Snippets)try catch
switch (Imported Visual C# Snippets)switch statement
while (Imported Visual C# Snippets)while loop
iterator (Imported Visual C# Snippets)simple iterator
propg (Imported Visual C# Snippets)Property with a 'get' accessor and a private 'set' accessor
Attribute (Imported Visual C# Snippets)Attribute using recommended pattern
do (Imported Visual C# Snippets)do...while loop
checked (Imported Visual C# Snippets)checked block
if (Imported Visual C# Snippets)if statement
lock (Imported Visual C# Snippets)lock statement
mbox (Imported Visual C# Snippets)MessageBox.Show
using (Imported Visual C# Snippets)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
C++
ctx Current file context
nguid Insert new GUID
unn union declaration
wcout Write to standard output stream
wclog Write to standard log stream
wcin Read from standard input stream
ctor Default constructor declaration with body
vdtor Virtual destructor declaration with body
dtor Destructor declaration with body
enumclass Enum class declaration
forr Reversed 'for'
clog Write to standard log stream
doc Documentation template
foreach 'range-based for' loop
wcerr Write to standard error stream
cerr Write to standard error stream
cin Read from standard input stream
cls Class declaration
cout Write to standard output stream
do do-while loop
else 'else' statement
enm Enum declaration
fori 'for' loop pattern with integer index
if 'if' statement
incg Include guard
main main declaration
ns namespace declaration
str struct declaration
switch Code snippet for switch statement
try Code snippet for try catch
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
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
foreach For Each block
Angular 2 HTML
ctx Current file context
nguid Insert new GUID
ngClass
ngFor
ngIf
ngModel
ngRouterLink
ngStyle
<script Create script tag
a Create tag attribute
JavaScript
ctx Current file context
nguid Insert new GUID
do (Imported JScript Snippets)do...while loop
dw (Imported JScript Snippets)writeln function call
else (Imported JScript Snippets)else statement
for (Imported JScript Snippets)for loop
for (Imported JScript Snippets)for loop
forin (Imported JScript Snippets)for...in loop
forin (Imported JScript Snippets)for...in loop
forr (Imported JScript Snippets)reverse for loop
forr (Imported JScript Snippets)reverse for loop
fun Create JavaScript function
function (Imported JScript Snippets)
if (Imported JScript Snippets)if statement
while (Imported JScript Snippets)while loop
with (Imported JScript Snippets)with statement
switch (Imported JScript Snippets)switch statement
try (Imported JScript Snippets)try catch statement
itar Iterate an array
generator (Imported JScript Snippets)generator
forof (Imported JScript Snippets)for-of loop
CSS
ctx Current file context
nguid Insert new GUID
TypeScript
ctx Current file context
nguid Insert new GUID
do (Imported JScript Snippets)do...while loop
dw (Imported JScript Snippets)writeln function call
else (Imported JScript Snippets)else statement
for (Imported JScript Snippets)for loop
forin (Imported JScript Snippets)for...in loop
forr (Imported JScript Snippets)reverse for loop
fun Create TypeScript function
function (Imported JScript Snippets)
if (Imported JScript Snippets)if statement
while (Imported JScript Snippets)while loop
with (Imported JScript Snippets)with statement
switch (Imported JScript Snippets)switch statement
try (Imported JScript Snippets)try catch statement
itar Iterate an array
forof (Imported JScript Snippets)for-of loop
ctor (Imported TypeScript Snippets) Code snippet for default constructor declaration with body
class (Imported TypeScript Snippets) Code snippet for class
module (Imported TypeScript Snippets) Code snippet for module
interface (Imported TypeScript Snippets) Code snippet for interface
enum (Imported TypeScript Snippets) Code snippet for enum
nidx (Imported TypeScript Snippets) Code snippet for number indexer annotation
sidx (Imported TypeScript Snippets) Code snippet for string indexer annotation
prop (Imported TypeScript Snippets) Code snippet for property
Resx
ctx Current file context
nguid Insert new GUID
d Create resource entry
Last modified: 7 December 2017