[DevExpress Support Team: CLONED FROM T409349: Cannot create new template in Coderush for Roslyn]
I attempted to import the classic settings. Showed an error during import. No details. After this, I can see that the template is there, but it appears I cannot bind a key to it. The UI says so, but it does not work.
Please help me make this work again in CodeRush for Roslyn.
Kind regards,
Jan Geert Hek
Hi Jan Geert,
I created a new template in CodeRush Classic options. Then, I removed this product and installed CodeRush for Roslyn.
After that, I imported the settings from CodeRush Classic using the "Import and Export Settings" menu item.
This operation was successfully completed. The template I created in the CodeRush Classic product was successfully ported to CodeRush for Roslyn.
Here is a video illustrating my attempts.
Also, it would be great if you send us your settings from the %appdata%\CodeRush for VS .NET\1.1\Settings.xml folder. We will use them to reproduce the problem under the same conditions as yours.
Jan Geert, you say that you cannot bind a key to the template. Please clarify what exactly you mean. Template settings do not use special key bindings. CodeRush expands its templates on the "Space" or "Tab" keys.
I used the import settings and got the following result:
Next, I used an alternative method to import the template.
Options > Editor > Code Templates > Templates
Create new category: JG
Right click newly created category, import templates, choose a prepared xml file that only contains my template. (included as attachment).
I get the 'Category Exists' message (in default dx blue theme), I choose replace, Ok.
After that template exists.
Here is the template
Here are the defined shortcuts (what you requested)
When I press Shift+Enter in the IDE, it does not work. I would very much like this to work. If that can be done by changing XML config files, no problem…
Hi Jan Geert,
Thank you for sending us additional information. I've analyzed it and I hope, now understand what happens on your side.
First, I've tried to export your settings and got an error, the same as shown on wizard-result.png.
I've registered a new ticket (CodeRush for Roslyn shows an error on importing a template) for this on your behalf to tack this issue separately.
Second, from the options-ide-shortcuts.png image I see that you created an alias in the templates and use it as a parameter in the TemplateExpand command.
Unfortunately CodeRush for Roslyn does not support this scenario yet.
I've registered a new ticket for this issue as well (CodeRush for Roslyn TemplateExpand command should support parameters) and addressed it to our developers. We'll make necessary corrections in the next updates and will inform you of our results.