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
 rename in external files
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

eduard
Junior Member

19 Posts

Posted - Oct 15 2013 :  06:49:56 AM  Show Profile  Reply with Quote
So...fun times.

I just renamed a few functions using VAX. Worked fine.

Except for that VAX also renamed the function in several source files, that are not actually part of the current project. Not even the current solution. In fact, they arent really related in any way, except for that the functions happen to have the same name.

Upon closer inspection, VAX indeed lists them as "external files" in the rename window, but checks them by default.


What the **** is this madness?


How dare VAX rename **** in random source files i happen to have on my PC? What's the logic behind this? Just WHY on earth would anyone want this?


And most importantly: how can i configure VAX to never ever touch anything that is not part of my current project?


Seriously, that option deserves to be OFF by default, with a big, red warning next to it. If you'll excuse me now, i'll be spending the next few days trying to pull wrongly named code from various places and people.

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Oct 15 2013 :  2:33:07 PM  Show Profile  Reply with Quote
Apologies for this problem, hopefully most or all of these code files are under source control, so you can undo the damage.

Are these library files?

Are these code files that you have opened in the IDE for reference? VA parses files when you open them, so if you have opened the files for reference this might be how come VA became aware of them.

In the Rename dialog, do you have "Search all projects" turned On or Off? Turning it off might help here, depending on exactly what happened.

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

eduard
Junior Member

19 Posts

Posted - Oct 15 2013 :  3:15:53 PM  Show Profile  Reply with Quote
Thinking about it, it's possible i opened them for reference in my VS window. Once, quiet some time ago.
At no point, however, was the file added to the project or solution, or even copied to the project directory.


I see no such option in the rename dialog (i'm still on build 7.1903) right now.


Ofcourse the code was source-controlled, but it made its way into long term storage and backup in a completely unmaintainable way, which is a big problem.


Is there currently no option to prevent VAX from modifying any files not part of the project? What do you suggest i do to prevent this from happening again?

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Oct 15 2013 :  10:59:16 PM  Show Profile  Reply with Quote
Apologies again for the problems this has caused you.

Its probably a good idea to trigger a rebuild of your VA symbol database, to make sure that VA forgets about any "stray" files you have opened while your solution was open. Press the button:

VA Options -> Performance -> Rebuild symbol databases

and restart your IDE.


Which version of VA are you using?

Can you please go to:

VA Options -> System Info -> Copy Info

and paste the details (from the clipboard) into your reply. This will give us the basic information about your setup.


What VA picks up to rename partly depends on what you renamed. Was this a class member function, or a function that was not part of any class or namespace? Without anything to help guide VA it will be harder to know which files should be updated, and which should not be updated.

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

eduard
Junior Member

19 Posts

Posted - Oct 16 2013 :  01:33:10 AM  Show Profile  Reply with Quote
I was running VS2008Sp1 with VAX 10.7.1903. I can paste in whatever info you need later on.

What i renamed was a set of stand-alone, old-school functions. no namespace or anything.


And yes rebuilding or manually deleting the database does the trick. I did that right away. But this is not a permanent solution, i cant rebuild the database every time
i open a file for reference. VAX did recognize the files as "external files", but checked them off in the rename dialog by default...maybe we can have an option "never rename in files that are not part of the current project"?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Oct 16 2013 :  3:15:14 PM  Show Profile  Reply with Quote
So far I cannot reproduce this problem here, using either VA 1903 or the latest release, VA 2001.

Can you please download the following simple VS2008 test project:

http://forum.wholetomato.com/colin/forumimages/topic11591_test_rename_external.zip

when you open the project, it contains a pair of files called "project_file". In the "external" directory you will find a pair of files called "external_file".

I have opened the "external_file" pair of files in VS2008, along with the "project_file" pair. If I trigger Rename on one of the "felineRenameTest" functions from one of the project files, then VA only lists files inside the solution.

If I trigger Rename from one of the external files, then Rename lists both the external files and the project files. This behaviour seems reasonable, since I am manually telling VA to perform the rename in the external file.

Can you please try the same tests on your system and see what results you get? I am wondering why you are seeing this problem so easily, and so far I am not seeing it at all.

zen is the art of being at one with the two'ness

Edited by - feline on Oct 16 2013 3:15:29 PM
Go to Top of Page

eduard
Junior Member

19 Posts

Posted - Oct 17 2013 :  12:44:39 AM  Show Profile  Reply with Quote
I can reproduce it

1) open your project
2) open the files "projectfile.h" and "projectfile.cpp"
3) file->open and opened "external_file.h /.cpp"
4) switched to "projectfile.cpp"
5) hovered over ...TestOne()
6) clicked the hover-button and hit rename
7) and got this:



Closing the external files didnt change this. Neither did renaming from the header.

Only after i hit "rebuild database" (and restarted the IDE) the "external files" entry goes away.

Edited by - eduard on Oct 17 2013 12:46:59 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Oct 18 2013 :  6:50:27 PM  Show Profile  Reply with Quote
Thank you for your very clear steps, I have done the same thing here, but am still getting a different result.

Can you please export your VA and IDE settings and send them to me:

VA Options -> Performance -> Export Settings
IDE tools menu -> Import and Export Settings -> Export selected environment settings

I can then import them here and see if I can reproduce the problem. I am assuming this different behaviour is down to a specific setting, but off hand I am not sure which setting.

Please submit the files via the form:

http://www.wholetomato.com/support/contact.asp

including this thread ID or URL in the description, so we can match it up.

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

eduard
Junior Member

19 Posts

Posted - Oct 19 2013 :  01:48:48 AM  Show Profile  Reply with Quote
done.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Oct 21 2013 :  1:50:48 PM  Show Profile  Reply with Quote
I have the settings, thank you:

case=77770

Can you please try turning Off:


Upon opening a file, parse all other unparsed files in the same directory:
VA Options -> Projects -> File Handling -> if Solution is not empty


and rebuilding your VA symbol database. This should fix the problem for you, it is fixing the problem for me. If your solution contains all of the files you are working on you should not need to turn this setting on. This setting is designed to help with makefile projects, where the project does not clearly list all of the code files that are being used.

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

eduard
Junior Member

19 Posts

Posted - Oct 22 2013 :  2:59:52 PM  Show Profile  Reply with Quote
Tested briefly, and yes, that seems to fix it! How did i miss that?

I have that setting turned on, because i am regularly debugging Qt code (though this applies to any CRT/STL/etc.) and i assumed this is what gives
me VAX capabilities (read: proper code highlighting, bolding of locals, etc.) in those "external" source files, too.

I can check that during the next couple of days.

Though i still like the idea of separating read/write access to external files. I dont have an issue with VAX parsing external files, and would like potential benefits that come from it, but write_access (by default!) is a big no-no.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Oct 22 2013 :  5:23:49 PM  Show Profile  Reply with Quote
This was one of those things that seems obvious when it is pointed out, but sometimes it takes a while to figure them out.

For Qt, you might find this post helpful:

http://blog.wholetomato.com/2008/11/20/using-qt-44-with-visual-assist-x/

basically VA needs to know where to look for the Qt library code, but so long as it can find it, all should be OK. Remember though Qt should be in the stable include directories, unless you are actually editing the Qt library?

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

sean
Whole Tomato Software

USA
2817 Posts

Posted - Oct 22 2013 :  7:48:08 PM  Show Profile  Reply with Quote
VA will load includes required when a file is opened - that happens regardless of the external files setting. The external files setting is only recommended for incomplete/partial solutions. For incomplete/partial solutions (think large sprawling codebases that have build systems independent of VS), VA will search for other files in the same directory and consider them part of the solution (affecting coloring/members lists/OFIS/FSIS/goto/etc).
Go to Top of Page

eduard
Junior Member

19 Posts

Posted - Oct 23 2013 :  12:33:06 AM  Show Profile  Reply with Quote
Just checked and it looks like it doesnt load includes. When i step through a Qt solution right now, Qt code is not recognized at all, i cant even alt+g (goto definition/declaration). What i have to do to get the code recognized is run the solution in the debugger and step into the Qt code. VS then opens the qt source file, VAX seems to process it (?) and i have code highlighting for that specific Qt class.


I have to do that for every single Qt class.


Now that i come to think about it - this is why i turned the option on in the first place, a long time ago.
Yes, Qt includes and source are in the "stable includes" of both VS and VAX.
Go to Top of Page

eduard
Junior Member

19 Posts

Posted - Oct 23 2013 :  12:43:50 AM  Show Profile  Reply with Quote
Huh, what's this?


I thought i'd turn on the "parse if solution is not empty" temporarily to allow VAX to scant the entire Qt directory - but even after turning it on and restarting the IDE VAX refuses to process "unprocessed files in the same directory"!


Dammit, what did i do now? :)


This also reflects in the NCB file: it's now 15MB, while it used to be 31MB.

Edited by - eduard on Oct 23 2013 12:44:46 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18943 Posts

Posted - Oct 23 2013 :  8:19:05 PM  Show Profile  Reply with Quote
Please place the caret into the file name in a #include line for one of your Qt headers. What does the #include line say, and what does the VA context and navigation fields show?

Checking this here, using the two simple lines:

#include <qstring.h>
#include <qlist.h>

I am seeing:

Context = qstring.h
Definition = C:\\Qt\\4_4_0\\include\\Qt\\qstring.h

and:

Context = qlist.h
Definition = C:\\Qt\\4_4_0\\include\\Qt\\qlist.h

It almost sounds as if VA is having problems working out where your #include files live.


How come your NCB file has changed size? This has nothing to do with VA, so changing your VA options or rebuilding your VA symbol database will never, on its own, effect this file or its size.

Have you deleted this file leaving the IDE to recreate it?

zen is the art of being at one with the two'ness

Edited by - feline on Oct 23 2013 8:20:24 PM
Go to Top of Page

eduard
Junior Member

19 Posts

Posted - Oct 24 2013 :  01:30:22 AM  Show Profile  Reply with Quote
when i rightclick->open file it opens these files:


C:\\Qt\\4.8.4\\include\\QtCore\\qlist.h
C:\\Qt\\4.8.4\\include\\QtCore\\qstring.h

which contain only one line each:

#include "../../src/corelib/tools/qlist.h"
#include "../../src/corelib/tools/qstring.h"

when i rightclick->open deocument these files i get the real deal:

C:\\Qt\\4.8.4\\src\\corelib\\tools\\qlist.h
C:\\Qt\\4.8.4\\src\\corelib\\tools\\qstring.h

But VAX wont parse other include files in the same director, ie in C:\\Qt\\4.8.4\\src\\corelib\\tools\\.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Oct 24 2013 :  11:23:41 AM  Show Profile  Reply with Quote
quote:
Originally posted by eduard
Yes, Qt includes and source are in the "stable includes" of both VS and VAX.



Can you please attach 2 screenshots of directories page in VA options dlg:
stable includes
source files
Go to Top of Page

eduard
Junior Member

19 Posts

Posted - Oct 29 2013 :  10:04:01 AM  Show Profile  Reply with Quote
sorry for the delay.

http://imgur.com/VENHGYD

I added the ..\\src\\ entry for testing to the include files, ignore it.


The fun goes on. I was renaming something in my project - and was one click away from destroying my VC include files. Safe bet to assume that i would have chased the problems until i would have given up and reinstalled VS as a whole. Yes, the checkboxes were checked by default. Lucky that i now double check anything that rename feature does.
Can you see why i would love for a feature "stay the hell away from anything not part of the current .vcproj"?

http://i.imgur.com/BSiH0Mq.png

Edited by - eduard on Oct 29 2013 10:05:46 AM
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Oct 29 2013 :  11:34:17 AM  Show Profile  Reply with Quote
There is a feature in the rename dialog to stay away from anything that is not part of the current .vcproj. It is a checkbox labeled "Search all projects" which in your screenshot is checked. If you don't want Visual Assist to search all files in the solution, then you don't want Visual Assist to "Search all projects" so you should uncheck "Search all projects."

You should also uncheck the "if solution is not empty" checkbox on the File Handling page of the VA Options dialog. The tooltip advice for that option states it is not recommended to be checked. It will continue to cause you problems and we are not going to change that behavior. It works for specific scenarios and clearly you are not happy with what it does. So uncheck it.

It appears that the reason VA does not parse and color Qt symbols is due to your stable includes not following the advice given in the blog post that feline previously linked to: http://blog.wholetomato.com/2008/11/20/using-qt-44-with-visual-assist-x/

The screenshot for the stable include files list shows only a single Qt directory whereas the blog post lists several.

Is there a particular reason you are using the Custom platform in the VA directories page?
Go to Top of Page

eduard
Junior Member

19 Posts

Posted - Oct 31 2013 :  03:23:38 AM  Show Profile  Reply with Quote
indeed there is. However, i actually meant "solution" not "project", i usually work with a solution that contains multiple projects. "if solution is not empty" is already unchecked.


Thanks, i'll change my includes as suggested in the blogpost. Wired - if i remember correctly, that didnt work and someone told me to use the VAX include options instead. Well, we'll see and i'll report back. :)
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Oct 31 2013 :  3:21:36 PM  Show Profile  Reply with Quote
Interesting - the screenshot of the rename dialog shows a node for External Files. External Files often implies the "solution not empty" checkbox.

If adjusting the include directories does not prevent the External Files node from appearing in the rename dialog, then we'll have to capture a log to see if we can figure out what is happening.
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