Rider Help

Predefined Live Templates for Global Usage

This topic lists all predefined live templates for Global Usage in Rider 2017.1. For more information about live templates, see Creating Source Code Using Live Templates

TemplateDetails
ctx

Current file context

Scope everywhere

Body

$CTX$

Parameters

  • CTX - Provides list of items describing current context. This includes file name, containing type name, namespace name, etc. (context)

This could be useful:

  • In string literals that contain references to the current context, i.e. Logger.LogError("Cannot find action ActionNameDerivedFromContext");
  • As an alternative to code completion where IntelliSense doesn't work properly - for example, in comments when documenting a member with a long name (see example below).

Before expansion

/help/img/dotnet/2017.2/Reference__Options__Templates__Live_Templates__Predefined__No_Language__ctx__before.png

Expansion options
/help/img/dotnet/2017.2/Reference__Options__Templates__Live_Templates__Predefined__No_Language__ctx__expansion.png

nguid

Insert new GUID

Scope everywhere

Body

$GUID$

Parameters

  • GUID - Generates new Globally Unique Identifier (GUID) (guid)

Before expansion

/help/img/dotnet/2017.2/Reference__Options__Templates__Live_Templates__Predefined__No_Language__nguid__before.png

After expansion
/help/img/dotnet/2017.2/Reference__Options__Templates__Live_Templates__Predefined__No_Language__nguid__after.png

Last modified: 11 October 2017