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
 Refactor: Problem in "Change Signature"
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mbobka
Ketchup Master

Russia
86 Posts

Posted - Jun 29 2006 :  04:00:12 AM  Show Profile  Reply with Quote

class ABC {
public:
	void FunctionA( int aaa );
};

void ABC::FunctionA( int aaa ) {
	int ccc = 10;
	aaa = ccc;

}


If I try to change signature of FunctionA, to "void FunctionA( char bbb, int aaa )", then:


class ABC {
public:
	void FunctionA( char bbb, int aaa );
};

void ABC::FunctionA(  char bbb, int bbb  ) 
{
	int ccc = 10;
	bbb = ccc;

}


As you see all "aaa" will be changed to "bbb" in the implementation, but the signature in the class declaration is valid.
Ctrl-Z (Undo) returns all bbb to aaa, and makes code valid.

Also, you can see mysterious second space inserted before "char bbb" in implementation.

support
Whole Tomato Software

5566 Posts

Posted - Jun 29 2006 :  11:54:24 AM  Show Profile  Reply with Quote
VA X thinks you are renaming aaa to bbb and changing its type, then adding a new parameter called aaa. VA X should be smart enough to realize you are only inserting a parameter.

VA X appears to work correctly if you inserts parameters *after* existing parameters.

We'll make VA X smarter so it detects an insert prior to an existing parameter, or we'll prevent the complex refactoring and force you to do it in multiple steps.

case=1513

Workaround is to refactor in two steps:
1) Change signature and insert all new parameters *after* existing parameters.
2) Change signature to reorder parameters.

Go to Top of Page

khb
Tomato Guru

Germany
337 Posts

Posted - Jun 30 2006 :  08:51:33 AM  Show Profile  Reply with Quote
I also have some thoughts regarding Change Signature. After adding a function parameter on the rightmost side of the signature, a message box appears that claims: "Removal and/or reordering of parameters detected...". Well, I just added a parameter, so the message is a bit misleading. Moreover, when adding a parameter with a default value on the rightmost side of the signature, no message box needs to be displayed as everything should work like before.

Regards,
Marcus.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jun 30 2006 :  6:00:15 PM  Show Profile  Reply with Quote
Suggestion to eliminate warning when adding a parameter with a default value in C# and C++ is...

case=1528

Problem of misleading warning is...

case=1529
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jul 05 2006 :  2:18:31 PM  Show Profile  Reply with Quote
Fix for case 1513 is in build 1528.

Change Signature does not mangle existing parameters when inserting new ones.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Aug 12 2006 :  11:23:15 PM  Show Profile  Reply with Quote
Case 1529 is fixed in build 1532.
Go to Top of Page

TheRawGod
Junior Member

11 Posts

Posted - Aug 18 2006 :  09:14:26 AM  Show Profile  Reply with Quote
And what about those spaces inserted after opening and before closing braces when changing signature / creating implementation?


class A
{
  int MemberA(int b);
};


after creating implementation it would look like:


int A::MemberA( int b )
{
  
}


Are those spaces a desired behaviour? Maybe it's worth allowing user to specify somehow on settings pages whether to insert them and how many?:)

Mentioned refactoring features are really handy but the fact that I have to remove those spaces is very annoying as usually deleting spaces requires about the same time I would spend doing copy/pasting in case of creating implementation that makes the latter refactoring functionality almost useless:(

WinXP SP2, MSVS2005, VAX 1532.
Go to Top of Page

rhummer
Tomato Guru

USA
527 Posts

Posted - Aug 18 2006 :  09:23:50 AM  Show Profile  Reply with Quote
TheRawGod: You can customize the formating of Create Implementation in the autotext entry called "Refactor Create Implementation"

Tools Engineer - Raven Software
VS2005 SP2/VS2008 SP1 - VAX <LATEST> - Win 7 x64

Go to Top of Page

TheRawGod
Junior Member

11 Posts

Posted - Aug 18 2006 :  09:30:16 AM  Show Profile  Reply with Quote
Ah, sorry for stupid question:(

Just tried and that worked fine.
Thanks.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Nov 18 2013 :  3:15:08 PM  Show Profile  Reply with Quote
Change Signature was overhauled in build 2007.
case=1528 is fixed in build 2007
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