Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 VAX 1524: refactoring: change signature

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Uniwares Posted - Jun 20 2006 : 3:11:09 PM
(vs2005, c++)
While the menu entry "Change signature" is available, it does not do anything at all when used on a ctor/dtor - sometimes.

I cant see a pattern, but it most frequently happens on new classes. just add a new class using the new class wizard and then try it on the created ctor/dtor.
14   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jun 26 2006 : 4:07:48 PM
*sigh* i have seen it fail myself, but only once. i have never been able to reproduce that problem, or may any headway with this.
Uniwares Posted - Jun 26 2006 : 1:50:57 PM
feline, you are pretty much describing what i did, step by step (except mine is not a MFC project, but that does not matter).
jpizzi has seen this already while reproducing another bug. Same randomness. Hmm, what thread whas that? going off to find it.
feline Posted - Jun 26 2006 : 1:46:33 PM
find references on a ctor finding all references to the class is a known issue

case=1262

to fix this properly would require matching parameters on function calls, plus deciding what is actually a call to a ctor.

however this should not, in theory, be relevant here. going back over the thread:

quote:
Originally posted by Uniwares

Just add a new class using the class wizard. But i see it on "old" classes too. Parsing seems not to have anything to do with it, since saving/re-opening doesnt change anything.


using VS2005, VA 1525 and a MFC C++ application i right click on the single project in solution explorer and select add -> class

i add a new class called "CRenameTest", accepting the defaults in the class wizard. this drops me into the new .h file, with a constructor taking a single void. run change signature on this to give it a single bool parameter, and it works perfectly.

i did this sitting in the header file, with the caret in the middle of the constructor declaration and used the keyboard, via the VAssistX -> Refactor menu to trigger change signature.

how are you triggering this? maybe it matters if you are triggering this operation a different way to me. certainly i am not having much luck reproducing this problem.
Uniwares Posted - Jun 24 2006 : 11:24:14 AM
Cleaned db and cache, rebuilt symbols. Problem persists.
Find References ... well the result can be argued about:
Made a find on the ctor, vax finds all occurences of the CLASS. So, yes it found all references of the ctor too. But that might be a bug on its own.
feline Posted - Jun 24 2006 : 09:51:33 AM
jpizzi if you run into another problem could you try just a find references on its own, to see what you get?
jpizzi Posted - Jun 24 2006 : 12:00:34 AM
When I tried it and it failed for me, I was using a constructor that had been in existence for several months. But, there might be something to that....
Uniwares Posted - Jun 22 2006 : 3:22:27 PM
closing the ide doesnt solve it for some classes. next thing - clean the db, we had troubles with that already once. gonna try that.
feline Posted - Jun 22 2006 : 3:14:12 PM
i have just seen this happen, once, but i cannot make it fail on demand.

i was running some tests for this thread: http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=4817 when it happened.

i was adding a parameter to a function that currently has no parameters. what i did notice was that Find References only had one reference in it the first time, when it failed. every time after that Find References has two entries, and both are updated.

this leads me to a rather wild theory - if you run Find References or change signiture quickly enough after using Create Implementation then VA does not seem to find both the declaration and implimentation via Find References, and so only one is updated.

so Uniwares, next time you find an example that fails can you try Find References on its own please? does giving VA a couple of minutes with an idle IDE to catch up seem to help? does the problem go away, or does it persist?
Uniwares Posted - Jun 21 2006 : 08:10:22 AM
Not working neither in .h nor .cpp files for me.
jpizzi Posted - Jun 20 2006 : 8:03:25 PM
OK. I have tried this in VS2005 (on XP) with 1524 and an existing C++ project.

I added a parameter to my constructor. This constructor originally had one parameter with a default value. I added a second (an "int") with a default value. Interestingly, VA detected that the signature changed, told me to update my references, but didn't change the code.

(edit)
For me, if I do it from the header file, it works. If I do it from the cpp, it does not. Is this the same for you, Uniwares?

(edit 2)
Well, after having it work in the header, it now works in the cpp. Let me restart VS....

(edit 3)
Well, it is working now. Just goes to support your assertion that it happens sometimes, I guess...
Uniwares Posted - Jun 20 2006 : 5:32:02 PM
Just add a new class using the class wizard. But i see it on "old" classes too. Parsing seems not to have anything to do with it, since saving/re-opening doesnt change anything.
feline Posted - Jun 20 2006 : 4:49:03 PM
what have you done? added two new files to a solution? or added the class to an existing set of files? or does it not matter?
how easily can you reproduce this?

it might make sense if VA had not parsed the new class code yet, but that sounds a little unlikely, since it will not offer me refactoring operations on code i have only just entered, it has to catch up with it before the options are offered.
Uniwares Posted - Jun 20 2006 : 4:20:16 PM
no, happens too with plain empty classes which have only ctor/dtor.
feline Posted - Jun 20 2006 : 4:01:47 PM
do you have overloaded constructors?

i have just tried this on a constructor and it worked fine, but there were no overloads and no base class.
then i tried it on a constructor with one overload, and again it worked fine, changing an overload with no parameters to one with one parameter.

this is odd.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000