T O P I C R E V I E W |
drjasonharrison |
Posted - Jul 16 2009 : 6:04:17 PM I was renaming a bunch of C++ member variables to match our naming convention and found that every other variable was not getting the "rename" option popping up. Typically I was renaming:
m_VariableOne m_VariableTwo m_VariableThree
to
m_variableOne m_variableTwo m_variableThree
This was a very repeatable behavior across several class declarations. Attempting to "skip" a member variable (1 then 3 then back to 2) would result in the same behavior, okay for 1, no rename for 3, then okay for 2.
Sometimes the variable would be "renamed" but not renamed in the .h file, only in the .cpp file. Or the rename dialog would come up but the compiler would tell me that the member variable was unknown.
-Jason
VA_X.dll file version 10.5.1727.0 built 2009.06.12 DevEnv.exe version 9.0.30729.1 msenv.dll version 9.0.30729.1 Font: Courier New 13(Pixels) Comctl32.dll version 6.0.2900.5512 Windows XP 5.1 Build 2600 S 2 processors (x86)
Platform: Win32 Stable Includes: C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\include; C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\include; C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include; C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\include; C:\\Program Files\\Java\\jdk1.6.0_12\\include; C:\\Program Files\\Java\\jdk1.6.0_12\\include\\win32;
Other Includes:
Stable Source Directories: C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfc; C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\mfcm; C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\atlmfc\\src\\atl; C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\crt\\src;
|
4 L A T E S T R E P L I E S (Newest First) |
support |
Posted - Aug 22 2009 : 7:22:35 PM case=29938 is fixed in build 1731 |
feline |
Posted - Jul 22 2009 : 5:43:34 PM In your solution, is rename offered reliably if you access it via one of the menus, IDE or right click? Or is it only offered some of the time here as well? I am wondering if this is a global problem or specific to the rename suggestions.
I am seeing the problem with the enum item:
case=29938
Is your computer busy - seeing a lot of CPU or hard drive activity? I have just seen some odd behaviour when testing this, but windows XP was installing IE 8 via automatic updates while testing this, so I am wondering if the CPU activity was causing problems. After the install finished I am not seeing any problems with the rename suggestions in the sample code. |
drjasonharrison |
Posted - Jul 22 2009 : 12:49:13 PM Okay, when I use your test case, it works.
However in my code, I'm just putting the cursor past the V in: m_VariableOne = 6; hitting delete, then 50% of the time the menu that pops up under the cursor contains "rename references" and "rename references with preview", and 50% it does not. Typing 'v' expands the completion menu to include the old name ( as well as the rename options if they were present). It does not matter if I give VA time to reparse the file, the behavior is consistent regarding the suggestion to rename.
When I add a enumeration typedef and define the first value, then the rename option does not appear on the popup menu. For example, e_fillNull will not be recognized for renaming, but e_FillOne will be, as will the subsequent enumeration values. Not sure if this is related.
class testRenameSeveralMembers { typedef enum FillSource { e_fillNull = NULL, e_FillOne, e_FillTwo, e_FillThree, e_FillFour };
private: int m_VariableOne; int m_VariableTwo; int m_VariableThree; int m_VariableFour;
public: testRenameSeveralMembers(); void InitVariables(); };
testRenameSeveralMembers::testRenameSeveralMembers() { m_VariableOne = 1; m_VariableTwo = 2; m_VariableThree = 3; m_VariableFour = 4; }
void testRenameSeveralMembers::InitVariables() { m_VariableOne = 6; m_VariableTwo = 7; m_VariableThree = 8; m_VariableFour = 9; }
|
feline |
Posted - Jul 20 2009 : 2:25:49 PM How exactly were you triggering the Rename command?
Using VS2008 and VA 1727 I have just added the following code to a header file:
class testRenameSeveralMembers
{
private:
int m_VariableOne;
int m_VariableTwo;
int m_VariableThree;
int m_VariableFour;
public:
testRenameSeveralMembers();
void InitVariables();
};
testRenameSeveralMembers::testRenameSeveralMembers()
{
m_VariableOne = 1;
m_VariableTwo = 2;
m_VariableThree = 3;
m_VariableFour = 4;
}
void testRenameSeveralMembers::InitVariables()
{
m_VariableOne = 6;
m_VariableTwo = 7;
m_VariableThree = 8;
m_VariableFour = 9;
}
and then sitting inside the class declaration I renamed each of the member variables, changing "V" to "v" at the start of the name. I added the functions to give Rename something more interesting to do.
I triggered Rename via the IDE VAssistX menu -> Refactoring -> Rename
Rename was correctly offered each time, immediately, and worked correctly each time. I just moved the cared down into the next variable each time.
If you are still seeing this problem can you give VA a couple of seconds after each rename, to give it time to reparse the current file, before triggering the next rename. Does this make any difference? |
|
|