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
 Change signature problems
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kinook
Senior Member

USA
37 Posts

Posted - Nov 17 2006 :  12:38:51 PM  Show Profile  Reply with Quote
I used the VA change signature command to update a C++ member method (while in the .cpp file) from

void CMainFrame::InitKeywordSearch(LPCTSTR userDefOnly)

to

void CMainFrame::InitKeywordSearch(LPCTSTR userDefOnly, bool param2 = true)

This chugged for a few seconds and updated only the .cpp file. Shouldn't it be smart enough to add , bool param2 = true to the header file and , bool param2 /*= true*/ to the .cpp file?

It also resulted in the following message being displayed:

---------------------------
Warning
---------------------------
Change in parameter list detected in new signature. You should now update references if they need to accommodate the new parameter list.
---------------------------
OK
---------------------------

First of all, the message is extraneous for C++ code, so it shouldn't be displayed at all. Second, the messagebox is not focused and must be clicked with the mouse in order to focus/dismiss. Is this a VA or VS thing and can it be disabled?

VA_X.dll file version 10.3.1540.0 built 2006.10.27
Licensed to:
VA X: xxxx@xxxxxxxxxx (1-user license) Support ends 2007.01.11
VA.NET 7.1: xxxxxx@xxxxxxxxxx (1-user license)
VAOpsWin.dll version 1.3.3.7
VATE.dll version 1.0.5.9
DevEnv.exe version 7.10.3077.0
msenv.dll version 7.10.3077.0
Font: Andale Mono 13(Pixels)
Comctl32.dll version 5.82.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
2 processors

Platform: Win32
Stable Includes:
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\PlatformSDK\\include\\prerelease;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\PlatformSDK\\include;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\SDK\\v1.1\\include;
D:\\Src\\boost_1_33_1;

Library Includes:
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\src\\mfc;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\atlmfc\\src\\atl;
C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\crt\\src;

Other Includes:


Automate your software builds with Visual Build Pro
http://www.visualbuild.com/

Edited by - kinook on Nov 17 2006 12:41:19 PM

kinook
Senior Member

USA
37 Posts

Posted - Nov 17 2006 :  12:49:37 PM  Show Profile  Reply with Quote
Shortly after this, the VS IDE crashed (due to refactoring?). After restarting, I did the same signature change again, and it did work, but

1) It still showed the warning dialog (it was focused this time, but still is unnecessary)

2) It changed the signature in the.cpp file to
void CMainFrame::InitKeywordSearch( LPCTSTR keyword, bool param2 /*= true*/ )

How can I prevent it from adding spaces near the parentheses?

3) Focus goes to the VA Find References Results pane (it should stay in the editor).

Automate your software builds with Visual Build Pro
http://www.visualbuild.com/
Go to Top of Page

kinook
Senior Member

USA
37 Posts

Posted - Nov 17 2006 :  12:55:41 PM  Show Profile  Reply with Quote
It seems to be sporadic as far as changing the signature properly. Sometimes it works, sometimes it updates only the .cpp file, and sometimes it changes the first existing parameter to the name of the one added (as well as uses of that parameter in the code).
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17256 Posts

Posted - Nov 17 2006 :  1:03:16 PM  Show Profile  Reply with Quote
point 1, removing this warning since it is not required is in the list to do

case=1528

I have seen this warning appear without focus on a few occasions, but only on one machine. I have never been able to reproduce it, or pin down the cause. If it appears without focus again can you keep an eye out for any sort of pattern or trigger, perhaps sections of the IDE autohiding?

point 2, edit the autotext entry "Refactor Create Implementation" and remove any spaces you do not want.

point 3, the focus has gone to Find References Results because VA is preparing for you to want to update the references. Is it simply because you have added a default parameter that focus should stay in the editor, or do you feel it should always stay in the editor?

This is probably just an extension of case=1528

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

feline
Whole Tomato Software

United Kingdom
17256 Posts

Posted - Nov 17 2006 :  1:07:04 PM  Show Profile  Reply with Quote
quote:
Originally posted by kinook

It seems to be sporadic as far as changing the signature properly. Sometimes it works, sometimes it updates only the .cpp file, and sometimes it changes the first existing parameter to the name of the one added (as well as uses of that parameter in the code).



That is not good. I have used Change Signature quite a lot, and never had these sort of problems.

Is this code held under source control? If so is it all checked out - files ready to edit, or are the files being checked out as you edit them? Or perhaps are the files flagged as read only?

Are all of the files local?
Do you have any other plugins installed?

The last effect, where parameters get renamed, could you post the before and after function signature? I am wondering if somehow the change you are making is confusing VA.

Undo should undo all of the changes in a single step, which is something.

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

kinook
Senior Member

USA
37 Posts

Posted - Nov 17 2006 :  1:09:35 PM  Show Profile  Reply with Quote
#3: I would prefer that focus always remain in the editor (and not do anything w/ Find References or show any messageboxes). I also once saw the message

---------------------------
Warning
---------------------------
Did not find any references that need to be updated.
---------------------------
OK
---------------------------

displayed on top of the other warning messagebox.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17256 Posts

Posted - Nov 17 2006 :  1:43:15 PM  Show Profile  Reply with Quote
Not wanting focus moved to Find References Results seems to fit into:

case=1158

Let me guess, you don't want to be told there were no references to update either? At least some of the time being told this would be useful.

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

kinook
Senior Member

USA
37 Posts

Posted - Nov 17 2006 :  3:09:38 PM  Show Profile  Reply with Quote
quote:
Originally posted by feline
Let me guess, you don't want to be told there were no references to update either? At least some of the time being told this would be useful.



Right, no prompts that have to be acknowledged (and it seemed a bit contradictory to show a message warning about changes followed immediately by one indicating no changes).

quote:
Originally posted by feline
That is not good. I have used Change Signature quite a lot, and never had these sort of problems.

Is this code held under source control? If so is it all checked out - files ready to edit, or are the files being checked out as you edit them? Or perhaps are the files flagged as read only?

Are all of the files local?
Do you have any other plugins installed?

The last effect, where parameters get renamed, could you post the before and after function signature? I am wondering if somehow the change you are making is confusing VA.



Yes, they're in source control, but the files are checked out and writeable. The files are all local. Only other addins are Eluent Tools, Fast Solution Build, and Project Line Counter.

Before:
void CMainFrame::InitKeywordSearch(LPCTSTR keyword)

After:
void CMainFrame::InitKeywordSearch(LPCTSTR userDefOnly, bool userDefOnly = true)

Automate your software builds with Visual Build Pro
http://www.visualbuild.com/
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17256 Posts

Posted - Nov 17 2006 :  4:38:02 PM  Show Profile  Reply with Quote
I know why you are having at least one problem, if you really did this change. The two parameters have the same name, so VA is going to be confused when it tries to work out what you did.

I have created a dummy test class and run this Change Signature, and if I leave the name of the first parameter alone and just add the bool then everything works correctly for me.

Undoing that running a second test where I rename the first parameter to "userKeyword" and add the second parameter, then VA renames the first parameter inside the function body - correctly, and adds the second parameter.

Was this just a one off event, or are you getting regular problems where the code changes are not right?
I recognise the Project line counter plugin, that is unlikely to be an issue. I don't recognise the other two though.

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

kinook
Senior Member

USA
37 Posts

Posted - Nov 17 2006 :  4:45:41 PM  Show Profile  Reply with Quote
What I entered for the new signature was:
void CMainFrame::InitKeywordSearch(LPCTSTR keyword, bool userDefOnly = true)

What it changed the signature to was:
void CMainFrame::InitKeywordSearch(LPCTSTR userDefOnly, bool userDefOnly = true)

Automate your software builds with Visual Build Pro
http://www.visualbuild.com/

Edited by - kinook on Nov 17 2006 4:51:56 PM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17256 Posts

Posted - Nov 18 2006 :  08:54:00 AM  Show Profile  Reply with Quote
*ah*

Clearly this is bad. Was this a one off problem?
I have never seen VA do anything like this on my machines, so I am wondering what caused this to go wrong like this.

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

kinook
Senior Member

USA
37 Posts

Posted - Nov 20 2006 :  10:09:04 AM  Show Profile  Reply with Quote
quote:
Originally posted by feline
Clearly this is bad. Was this a one off problem?
I have never seen VA do anything like this on my machines, so I am wondering what caused this to go wrong like this.



I can reproduce this consistently like this:

If the cursor is in the .cpp file within the parameters (parentheses) area of the method declaration, using Alt+A, R, G results in this in the Change Signature dialog

LPCTSTR keyword

and adding the parameter, bool userDefOnly = true causes the keyword parameter to also be renamed.

If the cursor is on the method name, the dialog contains

void InitKeywordSearch(LPCTSTR keyword)

and adding that parameter works properly.

Also, there is some inconsistency in access to refactoring. Sometimes the Change signature menu item is enabled but choosing it does nothing. And sometimes the menu item is disabled even though it seems like it should be enabled (for instance, when the cursor is right after the opening brace of a method).

Automate your software builds with Visual Build Pro
http://www.visualbuild.com/
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17256 Posts

Posted - Nov 20 2006 :  2:43:59 PM  Show Profile  Reply with Quote
Thank you for the very clear description, I had not thought of trying to trigger Change Signature on a parameter. I am getting mixed results, sometimes Change Signature runs and I see this bug, other times it does not do anything at all. I don't think it should be offered on the parameters, rename is already there for that.

For me Change Signature was offered, but only on the parameter its self, not on the parameter type, which makes sense.

For now try and avoid triggering Change Signature on a parameter, and this problem should go away.

case=3725

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

sean
Whole Tomato Software

USA
2817 Posts

Posted - Dec 19 2006 :  9:06:30 PM  Show Profile  Reply with Quote
case=3725 is fixed in build 1543
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Nov 18 2013 :  3:16:28 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:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000