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
 Last function in VA outline duplicated if dragged
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

steinsomers
Ketchup Master

Belgium
65 Posts

Posted - Nov 19 2007 :  12:08:21 PM  Show Profile  Reply with Quote
In an empty file, type
void f() {
}

void g() {
}
and wait a second for VA Outline to update, then in the Outline pane drag g() to move it before f(), and the result is:
void g() {
}

void f() {
}

void g() {
}



It doesn't happen all of the time. If you keep trying VA keeps doing it, but suddenly VA will change its mind and then you can throw functions in all directions and none get duplicated.

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Nov 19 2007 :  2:07:59 PM  Show Profile  Reply with Quote
Which IDE and version of VA are you using?
How easily can you reproduce this problem?

I have just tried this using VS2005 and VA 1618 and I am not seeing any problems. The description is quite clear, but I have tried this twice, creating a new cpp file, and starting dragging items in VA Outline very quickly, and dragging 20+ times.

zen is the art of being at one with the two'ness
Go to Top of Page

steinsomers
Ketchup Master

Belgium
65 Posts

Posted - Nov 22 2007 :  08:56:22 AM  Show Profile  Reply with Quote
This was VA 10.4.1618.0 built 2007.11.15 (strange, I remember VA had already found an update after I installed 1618) in Visual C++ 2005 SP1. Today in VA 1619, the situation is the same.
The chance of it occurring is perhaps 50% or more, but do note that it is a mode (or mood?) VA somehow gets stuck in. If VA is happy, you can do whatever you want in the file and it keeps working correctly. If VA is sour, it keeps duplicating the last function.

Except that, as far as I can tell, I can reliably enter sour mode by opening my real solution and trying a drag in a real .cpp file. Next I do:
1) Clean and Rebuild, close IDE
2) Remove solution.ncb
3) Open IDE on a solution with a single project with a single .cpp file containing the "void f(){} void g(){}" code
4) Wait for VA to parse standard headers
5) Drag g() in VA Outline (also if you drag it between f() and itself; if there are more functions, only the last one duplicates when dragged anywhere).

First attempt: VA remains in sour mode.

How did I get back to happy mode? Undoing, emptying files, changing function names, closing the file, closing VA Outline, doing the whole sequence from 1) again all don't help. The first time I got out of it by just waiting a long time. Suddenly after using unrelated programs, the still open solution was back in mint shape. Perhaps it was something subtle I did just before switching to another task. There was no way to cause the problem again other than triggering it in my real .cpp file again.

Second attempt: doing the sequence from 1) on didn't exhibit the problem.

Third attempt: triggered sour mode again with my real .cpp file, doing the sequence from 1) on brings the problem back to the simple file. And this time I think I made it really angry. Waiting doesn't help - sour mode is here to stay. So now I can't figure what in my real file turns VA sour, since I can't go back to happy mode.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Nov 22 2007 :  11:58:16 AM  Show Profile  Reply with Quote
At a wild guess it sounds like some form of database corruption problem, although I am not sure why it would be showing up like this.

Is there any change of getting a copy of this trigger CPP file for testing purposes? Assuming I can reproduce the problem here, I can then try and strip the file right down, to find what is causing the problem.

I understand if this is not possible, that is quite common.

The real problem here is that rebuilding the symbol database is not fixing the problem! Is your sample file part of your main solution? Or is it part of a new simple solution?

If the sample file is part of your main solution then it sounds like something in your main solution (the trigger file probably) is causing the problem. If you have:

VA Options -> Performance -> Parse all files when opening a project

turned on then this would make sense.

zen is the art of being at one with the two'ness
Go to Top of Page

steinsomers
Ketchup Master

Belgium
65 Posts

Posted - Nov 23 2007 :  07:17:02 AM  Show Profile  Reply with Quote
The sample file is not part of my main solution. It is in a separate solution with a single project which contains only the sample file. The main solution is closed and there is no devenv.exe process lingering.
I can send the trigger CPP file privately if you give me an address or a way to send an attachment, but I don't think it is worth the trouble. It's possible that the file contents cause the problem, but more likely that it's something completely different. Let's wait until someone else complains.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Nov 23 2007 :  10:05:39 AM  Show Profile  Reply with Quote
Well that should help to simplify things a bit.

If you open the file and then use:

VAssistX -> Tools -> Reparse Current File

before doing the drag and drop in VA Outline does this help?

If you click into VA Outline and use the keyboard instead of the mouse do you get the same problem? Scroll down to a function, use CTRL-X to cut it, scroll to a new position and use CTRL-V to paste it.

zen is the art of being at one with the two'ness
Go to Top of Page

steinsomers
Ketchup Master

Belgium
65 Posts

Posted - Nov 23 2007 :  12:43:28 PM  Show Profile  Reply with Quote
Reparse Current File doesn't help; it would have been a miracle, since cleaning the database doesn't help, and changing the file while Visual Studio is closed shows the updated contents.
Ctrl-X on a selection in VA Outline has matching behavior: all the selected functions are copied to the clipboard, and all selected except the last function in the file are cut from the file.

However your perseverance unraveled the mystery. As I pasted the clipboard in notepad, I noticed that line endings are LF, not CRLF. Normally all my code has unix-style line endings, and apart from notepad, no Windows program minds. If I switch the sample file to native CRLF line endings, VA Outline is instantly happy. I never figured when and why Visual Studio adds LF or CRLF to files as you edit them but somehow I ended up using LF even in the sample file.

Edited by - steinsomers on Nov 23 2007 12:44:28 PM
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Nov 23 2007 :  12:49:10 PM  Show Profile  Reply with Quote
Just to recap: are you saying that the outline is fine with LF except when working with the last item in the outline? And even then, the problem is intermittent?
Go to Top of Page

steinsomers
Ketchup Master

Belgium
65 Posts

Posted - Nov 23 2007 :  3:09:34 PM  Show Profile  Reply with Quote
Yes, the behavior is fine if line endings are LF only, except when working with the last item in a file. And the behavior is always fine if line endings are CR+LF. It seems entirely reproducable and explains what I first reported.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Nov 23 2007 :  5:24:34 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Changing the file format is the trigger, just as you say.

case=10092

zen is the art of being at one with the two'ness
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Dec 05 2007 :  5:55:17 PM  Show Profile  Reply with Quote
case=10092 is fixed in Build 1623
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