Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 refact:or: create new method

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
Mordachai Posted - Nov 09 2010 : 12:33:43 PM
I often find I need to specify the return type from such a refactoring (or/and the arguments list). It's simply impossible for VAX to understand what the inputs and outputs should be - but the interface forces me to be constrained to its best guess (wrong).

And I generally find that I cannot immediately follow up with "change method signature" - it's disabled. I assume that creating the new method somehow didn't get properly registered with VAX yet, and so it cannot recognize the symbol in order to allow me to further refactor it?

Fixing both would be ideal: I want to be able to correctly specify the interface when I refactor it initially, /and/ I'd like to be able to refactor the signature immediately if I find I need to further refine it.

:)
2   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Nov 15 2010 : 11:39:48 AM
Apologies for the delay in replying to this.

Are you using the refactoring command "Extract Method" on this code?

From the documentation: http://www.wholetomato.com/products/features/extractMethod.asp

quote:
Use care when including local variable declarations in the selected text to be extracted. Since the declaration is moved to the extracted method, referencing the variable in the original code outside the selection will result in a compile error.


This is something we are looking to catch, and warn you about:

case=4510

but this has not yet been done.

As for Change Signature, our parser does need a few moments to reparse the code after making the change, but this should only take a couple of seconds or so, after which you can run Change Signature on the new method.
Mordachai Posted - Nov 09 2010 : 12:52:21 PM
BTW, the reason that VAX gets the initial refactoring wrong so commonly is something like:

	CPoint cursor; 
	VERIFY(GetCursorPos(&cursor));
	ScreenToClient(&cursor);
	HWND hChild = ::ChildWindowFromPoint(m_hWnd, cursor);
	UINT id = hChild ? ::GetDlgCtrlID(hChild) : 0;

Asking for the above, it assumes no return value - but id (UINT) is the return value - it's the sum total from that function, and useless to keep it inside the refactored code!

It would be grand if it looked at unused side-effects and decided that they were the likely output from the refactored code. ;)

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