ReSharper 2016.2 Help

Sharing Templates

A simple way to share code templates is to export them them into files and then share these files with other developers, who in their turn, will be able to import and use the templates.

Another way of sharing templates with your team members is using the mechanism of settings layers that ReSharper uses to store code templates. To make templates available to other developers who work on the same shared solution, you can either create new code templates in a team-shared settings layer or copy existing templates to a team-shared settings layer.

To create a shared code template

  1. In the main menu, choose ReSharper | Tools | Templates Explorer… .
  2. In the Templates Explorer Window that appears, click one of the tabs to choose the type of the template: Live Templates, Surround Templates, or File Templates.
  3. In the Layer selector, choose Solution [solution name] team-shared or another custom shared layer.
  4. Follow the creating a template procedure.

To share existing code templates

  1. Click Manage Layers ThemedIcon.Settings.Screen.[Gray] on the Templates Explorer Window toolbar or choose ReSharper | Manage Options in the main menu.
  2. In the Settings Layers Dialog that appears, select a layer that contains templates to be shared.
  3. Right-click the layer, select Copy Settings To and choose Solution [solution name] team-shared or another shared settings layer in the context menu.
  4. In the Copy To dialog that appears, select the LiveTemplates check box under PatternsAndTemplates.
    Sharing_templates
  5. Click OK to complete the process.

In ReSharper's Storage of Templates, it is possible that some settings layers may contain modifications to templates defined in other layers. If you want to make sure that the layer you are going to share contains correct template definitions, choose this layer in the Layer selector, click Filter Templates toolbar__filter_usages and disable Show predefined templates, then find your templates and double-click them to study them. If you cannot find some user-defined template in a specific layer, but still you can see it when the Smart layer is selected, then this template is actually defined in another layer. If the template is visible in a specific layer, but some of its fields differ when the Smart layer is selected, then these fields are overridden in upper layers and these modifications will not be shared.

See Also

Last modified: 15 December 2016