Predefined Live Templates
This section lists all predefined Live templates in JetBrains Rider 2018.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, e.g. 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 | |
#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 |
ASP.NET MVC Html.ActionLink | |
ASP.NET MVC Url.Action | |
ASP.NET Controller RedirectToAction | |
Attached property | |
Dependency property | |
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 | |
For Each block | |
JavaScript | |
Current file context | |
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 |
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 |
Iterate an array | |
generator (Imported JScript Snippets) | generator |
forof (Imported JScript Snippets) | for-of loop |
CSS | |
Current file context | |
Insert new GUID | |
TypeScript | |
Current file context | |
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 |
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 |
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 | |
Current file context | |
Insert new GUID | |
Create resource entry |