JetBrains Rider 2018.2 Help

Template Scopes

JetBrains Rider defines a number of scopes where a code template can be available. Scopes help you limit usage of a particular code template to the relevant context.

For example, the predefined live template itar (iterate an array) is available by default in C# 2.0+ statements. It means that this particular scope is defined for this template; you can apply the itar template in the body of a C# statement, but you cannot apply it in the body of a C# class outside of any members or, say, in an XML file.

You can assign several scopes to each template. All template's scopes are shown in the Availability field on the template settings page:

template scopes 1

You can edit template scopes in a dialog that opens by clicking the Availability button. For detailed instructions, follow the Creating a Live/Surround Template procedure.

The scopes for live templates and surround templates are defined by file type and allowed location. The scopes for file templates are defined by project type.

Last modified: 4 October 2018