Merging CodeRush Templates (via Export and Import)

When a new version of CodeRush is released, it’s quite often the case that there are new templates included with it.

So why when you’ve completed the install, are these templates not always immediately available?

Well put simply, it’s because we don’t want to damage or break any Template customizations that you might have created yourself.

As you are no doubt aware by now, CodeRush is one of the most configurable products on the market. In this spirit, we allow you to add your own Templates or even customise the ones we offer you out of the box. If we were to overwrite these changes each time we installed, we’d upset people pretty quickly.

Since we don’t like to upset people, we choose instead to not overwrite your templates with our own stuff unless you ask us to.

This post is designed to show you how to merge your own custom Templates, with any new ones we might be shipping in a new release.

Step 0 – Always work within a ‘Custom’ folder

Yes there’s a step zero. This isn’t so much a step, rather more of a mind-set for when you’re creating templates of your own. We don’t force you to create templates in any particular way, but we do suggest that when you create new templates, that you do so inside of a new top level folder called ‘Custom’. By placing your Templates in this folder you are creating a single parent for all of your templates which will greatly ease the management of them in situations like merging.

Step 1 - Export your custom TemplatesTemplateContextMenu

  • Open up the Templates options page (Ctrl+Shift+Alt+OEditor\Templates)
  • Right-click the Custom folder (The one you always put your custom templates in) and choose Export Folder. Save the resultant file somewhere safe.
  • Repeat for each language where you have created Templates of your own.

Step 2  - Force CodeRush to rebuild your templates from defaults

  • Choose DevExpress\About
  • Click Settings
  • Dig into the Editor\Templates folder.
  • Delete (or move if you’re feeling more cautious) the files in this folder.
  • Switch back to VS
  • Return to the Templates options page again
    • Note: All of the templates will have been rebuilt from (new) defaults (without your custom templates)

Step 3 – Reimport your Custom Templates

  • Select in turn each language for which you exported a file in step 1.
    • Right-click the template tree and pick Import Templates
    • Select the previously exported file which pertains to your currently selected language.
    • Click Ok and note how the Custom folder returns to the template tree.
  • Repeat for each language

You have now merged the new templates with your own customizations, and are done.

You should be able to see your own custom templates, and any new ones shipped with the most recent version of CodeRush.

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.