JetBrains Rider 2020.3 Help

Reusable content in templates

Include templates are used to define reusable pieces of code (for example, standard headers, copyright statements, and so on) to be inserted in other templates by means of the #parse directives.

The #parse directive has the following syntax:

#parse("<include_template_name.extension>")

For example:... #parse("JavaScript File Header.js").

Templates that can be referenced in this way in other templates are listed on the Includes tab of the Editor | File Templates | Other Languages page of the Settings/Preferences Ctrl+Alt+S.

To create an include template

  1. In the Settings/Preferences dialog Ctrl+Alt+S, go to Editor | File Templates | Other Languages.

  2. Open the Includes tab.

  3. Click Create Template Create Template on the toolbar and specify the include template name, extension, and body.

To insert a reusable template into another template

  • Add the #parse directive with the name of the include template that you want to insert. For an example, see template syntax.

Last modified: 09 March 2021