T O P I C R E V I E W |
EugeneKozlov |
Posted - Jan 16 2016 : 02:07:25 AM Hello,
I suppose that 'Rename' of function parameter should change both definition and declaration. It is better than change only one piece of function, isn't it?
Thank you |
10 L A T E S T R E P L I E S (Newest First) |
ChrisG |
Posted - Jun 18 2020 : 01:35:20 AM case=20637 is fixed in build 2380. https://support.wholetomato.com/default.asp?W404#2380 |
sean |
Posted - Feb 02 2016 : 7:52:24 PM Change Signature failing to rename the parameter in the implementation is fixed in build 2089. However, case=20637 is still open. |
sean |
Posted - Jan 20 2016 : 4:05:38 PM It fails for me as well. It looks like an entirely unrelated issue to the one I thought I was responding to. Thanks for your follow-through.
And yes, it appears that 85429 is a duplicate of 20637.
|
EugeneKozlov |
Posted - Jan 20 2016 : 1:38:35 PM > triggering Change Signature on the function and making a change works, both the declaration and the implementation are updated correctly Implementation is not updated correctly. I has the following code after Change Singature for your example:
using namespace spaceTestingChangeSig;
void spaceTestingChangeSig::testRefactoring::testRenameParamUsingNamespace(int nFirst)
{
nSecond += 2;
}
PS: Are cases 20637 and 85429 similar? |
feline |
Posted - Jan 19 2016 : 4:09:46 PM I think I am seeing the same problem. Using this simple test case, this code in the header file:
namespace spaceTestingChangeSig
{
class testRefactoring
{
void testRenameParamUsingNamespace(int nSecond);
};
}
and this code in the matching cpp file:
using namespace spaceTestingChangeSig;
void testRefactoring::testRenameParamUsingNamespace(int nSecond)
{
nSecond += 2;
}
triggering Change Signature on the function and making a change works, both the declaration and the implementation are updated correctly, but the namespace is added to the implementation, even though it is not needed.
case=85429
Is this what you are seeing? |
EugeneKozlov |
Posted - Jan 19 2016 : 04:49:33 AM > This statement is incorrect in other cases All my classes are placed in the namespace. Change Signature is always adding garbage namespace prefix. So it always 'thinks' that my definition is out-of-sync. |
sean |
Posted - Jan 18 2016 : 2:20:12 PM I should note that my previous comment only applies when the parameter names are out of sync (when comparing definition vs declaration).
This statement is incorrect in other cases: >However, Change Signature does not perform Rename for parameters. It just change header without touching body.
Change Signature does in fact update both definition and declaration (since 2013 as of build 2007).
|
sean |
Posted - Jan 18 2016 : 2:12:34 PM Yes, it appears that when the declaration and definition do not use the same parameter name, Change Signature will only make the declaration match the definition. It will not run if the signature is unchanged (as taken from declaration) -- making it impossible to make the definition match the declaration in a single step. Changing the declaration to match the definition is possible in a single step. Getting them in sync as taken from the definition requires two steps.
Once definition and declaration are in sync, Change Signature will modify both as expected.
I have opened a feature request to allow Change Signature to run in this scenario (out of sync, trying to make declaration match definition). case=94526
|
EugeneKozlov |
Posted - Jan 17 2016 : 09:46:45 AM However, Change Signature does not perform Rename for parameters. It just change header without touching body.
PS: I see 10 topics starting from 2007 except my one. So.. It will not be fixed soon, am I right? |
accord |
Posted - Jan 17 2016 : 06:55:49 AM We are considering to implement this at some point:
case=1140
For now, you can use Change Signature to change parameter names. |