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
 Add Include on files in the same folder
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jbartley
New Member

USA
2 Posts

Posted - Mar 05 2015 :  2:29:43 PM  Show Profile  Reply with Quote
When I do an Add Include on a file in the same folder as the cpp file, I do not get any path information in the include.

Example:
I'm in foo.cpp, I highlight the foo class and choose Add Include.
Resulting include looks like
#include "foo.h"

What I want is for the include to include the full project path to foo.h, e.g.:
#include "folder/foo/foo.h"

I am already setting the AddIncludePreferShortestRelativePath registry value to 0 so that I do not get ".." relative paths. How can I also force Add Include to use full paths for files in the same folder?

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Mar 06 2015 :  12:15:49 PM  Show Profile  Reply with Quote
Unfortunately no, there is no current way to tell VA to do this. We are considering adding this, but its not currently a high priority:

case=33851

Out of interest why do you want this? There is no need to add the path in this situation, the code compiles perfectly happily for me.

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

jbartley
New Member

USA
2 Posts

Posted - Mar 06 2015 :  12:19:14 PM  Show Profile  Reply with Quote
We would like to have consistency in our include statements across the codebase.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Mar 06 2015 :  1:33:55 PM  Show Profile  Reply with Quote
That makes sense. I have added a note about this to the feature request, but unfortunately it is unlikely to happen any time soon.

For now you may find using a VA Snippet helps you to fill in the path information. You could use a snippet that inserts $FILE_PATH$, which will give you the path of the current file, which could then be trimmed down to give you the path information you want to add to the #include statement. The full list of VA Snippet reserved strings is here:

http://docs.wholetomato.com/default.asp?W262

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

dbarrie
New Member

USA
6 Posts

Posted - May 27 2015 :  7:05:54 PM  Show Profile  Reply with Quote
I would like to cast my vote for the inclusion of this feature as well! I just spent 20 minutes trying to figure out why the AddIncludePreferShortestRelativePath setting wasn't working, only to realize I was testing it on a symbol that was defined in a header file in the same directory as the source file I was testing with! While I'm glad to discover that the setting does indeed behave as expected, it'd still be great to have an option to make it behave the same way for headers in the same directory as the source file, just to keep things consistent across our (very large) codebase!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - May 28 2015 :  12:43:22 AM  Show Profile  Reply with Quote
I have put a note on the case about your interest in this, but this is not currently a high priority, so I am not sure if or when we will look at this.

Are you aware that if you place the caret into the filename on the #include line VA shows you the full path of the file in the Definition field, normally visible at the top of the editor window. You can copy and paste the full path from here, or just a part of it, if that helps you to edit the #include statement.

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 - Sep 24 2018 :  2:31:04 PM  Show Profile  Reply with Quote
case=33851 is implemented in build 2291 -- see Add Include path on the Code Generation page of the VA Options dlg.
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