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
 Refactoring: Rename variable doesn't work
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

xMRi
Tomato Guru

Germany
315 Posts

Posted - Feb 07 2017 :  03:15:04 AM  Show Profile  Reply with Quote
Here the code I have:

STDMETHODIMP CFoo::put_ShowParameter(VARIANT_BOOL pVal)
{
	AFX_MANAGE_STATE(AfxGetAppModuleState());

	// Need the init
	HRESULT hr = m_data.Init();
	if (FAILED(hr))
		return hr;

	m_data.m_bShowParameter = pVal!=0;

	return S_OK;
}


I point my cursor in the function header on the argument pVal.
I try to choose VAX Rename.

The cursor jumps on put_ShowParameter and only allows me to rename the function.

Selecting pVal and use rename again.Shows no match.

Using Build 2118.

Martin Richter [rMVP] WWJD http://blog.m-ri.de
"A well-written program is its own heaven; a poorly written
program is its own hell!" The Tao of Programming

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Feb 07 2017 :  11:24:31 AM  Show Profile  Reply with Quote
Thank you for the very clear example and description. I am seeing a similar result, the caret jumps for me, and I am left opening the VA Refactor context menu, via Alt-Shift-Q, on the function, not the parameter. When I trigger Rename directly on the parameter, some references are being found for me, but the function definition in the .h file is not being picked up. So clearly this is not working correctly:

case=103619

I am not sure why I am getting some references and you are not getting any references to the parameter though, that surprises me.

Can you please try running Change Signature on the function, and see if this renames the parameter for you correctly? This is working for me, so hopefully this will work reliably for you as well.

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