Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Swapping between different refactoring snippets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

feline
Whole Tomato Software

United Kingdom
18755 Posts

Posted - Dec 07 2007 :  3:17:34 PM  Show Profile  Reply with Quote
Sometimes you may want to move between different Snippets for refactoring in the same language. For example you want to use different styles of comment via Document Method for different projects, or more simply you may want to have different formatting for Move Implementation to Source File and Create Implementation in different projects.

There can only be one active Snippet at a time for Visual Assist X's refactoring. If you clone the Snippet "Refactor Document Method" Visual Assist X will simply use the first instance it finds in the tree.

Since re-ordering the items in the tree to control the formatting is not very clear, simply rename the entry you do not want to use.

So you might have "Refactor Document Method" and "Refactor Document Method XML". The second Snippet will be ignored, since it has the wrong Title, but it is easy to see what it is. When you want to change formats simply rename them to become "Refactor Document Method Doxygen" and "Refactor Document Method"

This does require you manually opening the VA Snippet Editor dialog and making the changes by hand each time you want to change the format.

It is possible to automate this, by editing the TPL files directly. Snippets are stored as text files, see this FAQ entry for details of where to find the TPL files:

http://support.wholetomato.com?W434

If you edit the TPL file while the IDE is running Visual Assist X will detect this and automatically re-load the file in the background, picking up any changes you made in the process.

I actually wrote a simple VBScript file to do edit the C++ TPL file, replacing one format of "Refactor Document Method" with another, which is controlled via a command line argument. You could easily assign this to a menu item via the VS2005 menu item "Tools -> External Tools..."

You can download the file from here:

http://forum.wholetomato.com/colin/faq/update_snippet.zip

Please NOTE this file is simply a proof of principle, an experiment, and it is not officially supported. Since the path to the C++ TPL file is hard coded it is unlikely to work on your system without first being edited, and even then it does not do very much. It simply exists to get you started if you want to experiment with this idea.
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000