JetBrains Rider 2018.2 Help

Handlebars and Mustache

With JetBrains Rider, you can use Handlebars expressions and Mustache templates in hbs or mustache files. JetBrains Rider processes contents of such files according to default or custom settings specified on the Templates page of the Settings/Preferences dialog.

Before you start

To configure Handlebars and Mustache in JetBrains Rider

  1. In the Settings/Preferences dialog (Ctrl+Alt+S), click JavaScript unhder Languages and Frameworks, and then click Templates.

  2. On the Templates page that opens, switch to the Handlebars/Mustache area.

  3. To automatically insert the second closing curly brace (}) of a Handlebars expression on typing the first closing one, select the Automatically insert closing tag checkbox.

    JetBrains Rider also recognizes triple stashes ({{{) that prevent escaping values inside expressions. In this case, JetBrains Rider automatically inserts two closing curly braces as soon as you type the first closing one.

  4. To automatically reformat Handlebars expressions and Mustache templates on code generation, refactoring, or pressing Ctrl+Alt+Enter, select the Enable formatting checkbox. Otherwise, JetBrains Rider always keeps their original formatting.

  5. Choose the language to use the style for comments from. When you enter a line or block comment by pressing Ctrl+Alt+/ or Ctrl+Shift+/, JetBrains Rider inserts the comment delimiters that are used in the chosen language, for example:
    • {{!----}} for Handlebars

    • /**/ for JavaScript

    • <!----> for HTML

Last modified: 21 December 2018

See Also

Language and Framework-Specific Guidelines: