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
 Feature Requests
 Improved Refactoring Snippets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gdobratz
Junior Member

USA
17 Posts

Posted - Jan 25 2010 :  6:41:39 PM  Show Profile  Reply with Quote
It would be helpful if the Symbol Context reserved strings worked in refactoring snippets. Specifically $BaseClassName$ and $MethodArgs$ would be most useful. (By the way the context menu presents them as choices, but they do not work.)

It is often useful to make a call to the base class method, so a it would be nice to be able to include something like:

$BaseClassName$::$MethodName$( $MethodArgs$ );
or
$BaseClassName$::$SymbolName$( $MethodArgs$ );

feline
Whole Tomato Software

United Kingdom
18947 Posts

Posted - Jan 26 2010 :  10:53:18 AM  Show Profile  Reply with Quote
Which refactoring command are you trying to do this with?

zen is the art of being at one with the two'ness
Go to Top of Page

gdobratz
Junior Member

USA
17 Posts

Posted - Jan 26 2010 :  1:43:45 PM  Show Profile  Reply with Quote
I tried it in Refactor Create Implementation. When that did not work, I didn't try it in any others.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18947 Posts

Posted - Jan 27 2010 :  11:10:49 AM  Show Profile  Reply with Quote
I see what you are trying to do now, and also why this is not working. The VA Refactoring commands have to work slightly differently, since often the symbol context cannot be picked up from the caret position. E.g. when the refactoring is triggered via Right click in VA Outline.

What exactly are you trying to achieve? You mention calling the base class method. Using the following simple code example:

class testFindRefBase
{
public:
	testFindRefBase();
	const char *displayResult() { return "base format"; }
	void testCallingBaseForm(int nParam1, int nParam2) { }
};

class testFindRefChild : public testFindRefBase
{
public:
	testFindRefChild();
	const char *displayResult() { return "child format"; }
	void testCallingBaseForm(int nParam1, int nParam2)
	{
		|
	}
};


at this point I type "base", which is the shortcut for a new VA Snippet I have just added:

$BaseClassName$::$MethodName$( $MethodArgs$ );

which inserts a call to the base class version of this function, which sounds like it is what you want.

zen is the art of being at one with the two'ness
Go to Top of Page

gdobratz
Junior Member

USA
17 Posts

Posted - Feb 01 2010 :  6:35:18 PM  Show Profile  Reply with Quote
I was attempting to have the refactoring snippet automatically insert the base class call.

Obviously things work as expected if you let the refactoring snippet insert the method and then go into the method and use another snippet to insert the base class call.

I was trying to change a two-step process into a one-step process.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18947 Posts

Posted - Feb 03 2010 :  9:26:24 PM  Show Profile  Reply with Quote
This makes sense, now I see what you are after. I have put in a feature request for this:

case=39184

zen is the art of being at one with the two'ness
Go to Top of Page
  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