Author |
Topic |
|
jacktripper1000
New Member
3 Posts |
Posted - Jun 20 2007 : 01:30:11 AM
|
Hi, I am evaluating this product and downloaded the latest version (1557). I am getting several errors when refactoring C++ code. Here are some facts:
a) Using Visual Studio 2005 SP1 on WinXP Pro SP2 (all latest service packs). b) No other plugin installed in VS2005. c) 1.25 GB RAM.
Problems:
1. Rarely, this product crashes in middle of refactoring.
2. Refactoring fails in some cases. Sometimes the product tells me that it failed (and that's okay), but sometimes it doesn't. For example:
Refactoring enum* to f* didn't refactor some symbols here.
enum WordMatch { fMatch = 0, fPrefixMatch = (1 << 0), fSuffixMatch = (1 << 1), enumWholeWordMatch = (enumPrefixMatch | enumSuffixMatch) };
Are there any settings I need to do or some cache I need to clear? How can I make this work correctly?
Jack
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Jun 20 2007 : 07:56:11 AM
|
Problem 1, VA should never crash, and certainly not during refactoring. How often are you seeing this happen? Every few hours? Every couple of days?
Is there any form of pattern to the problem? Does it seem to be related to specific refactoring operations, or does it appear random?
Any chance of getting a call stack next time VA crashes?
Problem 2, we need to look at these problems on a case by case basis to be honest. The example you posted is definitely a bug. VA has no problem renaming the enum item when it is used like that inside a function, but it is not expecting to see this inside an actual enum, so it is failing to pick it up:
case=7191
When it tells you the refactoring has failed, which operations are failing? Is it always rename, or is this happening on other operations as well? Normally refactoring is very solid, and off hand the only time it should report a failure is when you try to modify a cpp file that cannot be modified, e.g. using Move Implementation to Source File where the cpp file is read only. |
zen is the art of being at one with the two'ness |
|
|
jacktripper1000
New Member
3 Posts |
Posted - Jun 20 2007 : 11:21:34 AM
|
I think mostly rename operations are failing. Not too often though.
Problem 1: Crashed 3-4 times in 2 days. Usually in middle of refactoring. If I had to take a guess I would say that its after refactoring when refreshing the VS 2005 class display. I will try to get stack trace next time.
Problem 2: IIRC,, Usually the operations that are failing (with an error message) are enum renames. I find that it fails to rename just 1 value in whole solution when this happens in the form of default value to a function. e.g. MyClass::foo(int x, Flags f = MyClass::eDefault); Sometimes, the eDefault when renamed to fDefault fails in this.
Problem 3: (NEW) Refactoring fails to refactor copy constructor and assignment operator (again in few cases, not all).
Problem 4: (NEW) Refactoring enum fails in switch case statements if the code is in same file. Happened twice today. That's all. e.g. class MyClass { enum Enum {Default, In, Out}; static foo(Enum e) { case MyClass::Default: break; case MyClass::In: break; }
Failed for one value, worked fine for other value. Don't remember if it was the first or last value of case structure.
Problem 5: (NEW) May not be related to VAX, but after refactoring, the class explorer does not shows updated symbol. Again this is quite infrequent. But when this happens, I have to shut down VS and restart it. Maybe a VS2005 issue.
Problem 6: This is a little bizzare. After I rename a symbol, sometimes the VAX waits for a while. I think its reparsing the file. However sometimes, I select a different word to rename and the rename option is disabled. Then I need to minimize VS2005 and bring it back and it is enabled again. I have waited for a long time just to make sure its not my paranoia. Also VAX is not parsing any file during this time (as seen in status bar).
Note: Just to mention, after crash I purged all files in Document&Settings/<user>/Local Settings/Visual Assist/VS8 just to get a clean start.
HTH,
Jack
|
|
|
jacktripper1000
New Member
3 Posts |
Posted - Jun 20 2007 : 2:49:21 PM
|
Sorry but I am beginning to get annoyed.
Problem 7: Refactoring fails to identify typedef'd base class initialization. Sample code: I have 3 files: myclass.h, myclass.cpp, myclass.inl (inline include file).
class MyClass: public MyBase { typedef MyBase Parent; public: MyClass(int x); };
.cpp
MyClass::MyClass(int x):Parent(x) {}
If I rename 'Parent' to 'Base' starting with header, VAX fails to rename Parent in cpp file.
Also noticed that the slowness or delay in rename being enabled seems partly related to network. If I am connected to internet, its slow else its better. Is VAX looking for something and timing out? I have zonealarm and have disabled network access to VAX.
BTW, all my files are on local hard drive and do not have any network drive so this must be VAX.
-Jack
|
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Jun 21 2007 : 09:19:01 AM
|
Problems 1 and 5, are you referring to the IDE's Class View here? Or are you referring to the bottom section of VA View, the Hovering Class Browser?
VA should not be having any effect on the IDE's Class View, and the content of the IDE's class view comes from the IDE's own intellisense scanner. This is known to be slow and a major CPU hog under some conditions, which is why quite a few of our users have disabled it entirely. So a delay in seeing the IDE's Class View may simply be due to the IDE not having caught up with the code changes yet.
If you run a CPU monitor you may find that the IDE is using a lot of CPU time, and you have to wait for this to stop before you see any updates to the Class View.
Problem 2, the error message, would you be able to tell me the exact text of the error message you are seeing, or simply post a screen shot? I run rename a lot, especially when testing things, and I cannot remember the last time it produced an error message for me.
Problem 3, refactoring the copy constructor and assignment operator functions, for the overloaded assignment operator function try triggering refactoring on the keyword "operator". For some overloaded operators, e.g. casting to "int" the operator keyword is the only reliable trigger spot for VA's refactoring.
We do not try to offer some refactoring operations on overloaded operators, due to the extreme difficulty of doing so reliably. For example we do not offer change signature on casting to int.
However refactoring should be consistent, not random.
Problem 4, there is a known bug with a switch on an enum - if your switch statement looks like:
case stateConnected:
ASSERT(FALSE);
break;
case stateDisconnected:
ASSERT(FALSE);
break;
then VA will think the enum items "stateConnected" and "stateDisconnected" are local variables. In this case they will be coloured as local variables, rather than enum items. If you have turned on VA's Enhanced Syntax Coloring then enum items will be coloured according to:
VA Options -> Advanced -> Fonts and Colors -> Preprocessor maros
This is discussed here: http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=6027
does this sound like it might be what is happening in your code?
Problem 6, the rename operation being disabled - I may know what is happening here. Assuming you are moving the caret through your code, and using the "IDE VAssistX -> Refactoring -> Rename" menu item VA has to work out where in the file you have placed the caret, and exactly what you have placed the caret in (variable, function, keyword, etc) to know which refactoring operations, if any, should be offered.
Sometimes, especially when the machine is busy, VA does not have time to work this out before you open the menu. When this happens normally all refactoring options are disabled. When this happens move the caret up or down a line, wait a second or two and then move the caret back again. This should be ample time for VA to figure out what is going on, and moving the caret causes VA to re-evaluate what options should be offered.
Hopefully this makes sense.
Problem 7, using VS2005 and VA 1557 with just a cpp and .h file pair I have added the following code to the header file:
class bugRenameTypedefBaseClass
{
public:
bugRenameTypedefBaseClass(int nFoo) { }
};
class bugRenameTypedefChildClass : public bugRenameTypedefBaseClass
{
typedef bugRenameTypedefBaseClass Parent;
public:
bugRenameTypedefChildClass(int nFoo);
};
and the following code to the matching cpp file:
bugRenameTypedefChildClass::bugRenameTypedefChildClass( int nFoo ) : Parent(nFoo)
{
}
When I sit in the header file and rename "Parent" both instances of Parent (one in the header and one in the cpp file) are updated correctly.
Could you try copy / pasting this code into your project and see what happens when you run rename? I am wondering if there is something about your actual code that is confusing VA that is not present in your example.
The delay on rename and the internet... there should be no connection at all. Off hand the only possible reason a network connection might matter, given all of the source is local, is if your project contains an additional include directory like "\\\\machine_name\\library\\"
Here VA would try to scan this location some of the time for header files, but this should not effect only the delay before rename is enabled. If your CPU is very busy while you are working on the internet then this might explain the slow down, but unless your CPU was running at 100% I would not expect any noticeable effect.
I am very sorry that you are running into so many problems with VA. I will do what I can to help you resolve them. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|
|
|