ReSharper Help

Code Templates in JavaScript

The key features of ReSharper's code templates are also supported in JavaScript. You can find the detailed information on these features in the corresponding topics of the Code Templates section. In the main topic of the section, you can also find the feature matrix and check what exactly is supported in JavaScript.

In this topic, you can find some examples of using code templates features in JavaScript:

Live templates

Live templates contain predefined code fragments. Code fragments can be easily and quickly inserted in your code, that saves the time

To view the list of live templates delivered with resharper

  1. On the main menu, choose ReSharper | Live Templates.
  2. The Templates Explorer window opens.
  3. Click the Live Templates tab. For more information about the tab, see Predefined Live Templates.
  4. In the tree view find and expand the Predefined Templates node.
  5. Find and expand the JavaScript node.
  6. The list of predefined live templates that are available for JavaScript is displayed.

Each template is identified by abbreviation, to figure out what lies under the abbreviation select the template and look at the bottom of the Templates Explorer window. For more information about variables used in templates, see Template Parameters and Predefined Live Templates.

The procedure of applying live templates for JavaScript is the same as for other languages, you can find ithere.

You can not only use templates, but also create them. You can add a template manually or ReSharper can generate a new template from the selected source code. For more information, see Creating a Template and Creating a Live Template from Source Code.

See Also

Last modified: 30 June 2015