简体   繁体   中英

Visual-Assist Add Include directive

I have a project name "HelloWorld"

Folder "include"
Class1.h
Class2.h

Folder "src"
Class1.cpp

If I use the the feature "Add #include Directive" from Class1.cpp , the following include gets added:

#include "..\include\Class2.h"

But in my project I don't use relative paths, so I would like to get something like this:

#include <MyProject\include\Class2.h>

Is there a way to do it?

I have what you want happening, with Visual Studio 2015 and Visual Assist build 2094.

In the Project properties (right click on the project, not the solution, in solution explorer) and set:

C/C++ -> Additional Include Directories = the path to the directory holding MyProject\\

then exit Visual Studio and set the registry key:

HKEY_CURRENT_USER\\Software\\Whole Tomato\\Visual Assist X\\VANet14\\AddIncludePreferShortestRelativePath = 0

as described here:

https://wholetomato.fogbugz.com/default.asp?W336

then finally, since in your example you have the #include line using <>, I set:

VA Options -> Code Generation -> Add Include style: <>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM