Visual Studio Code includePath Code

I am struggling with installing includePath in a larger project. Let's say I have a folder structure like:

/BaseComponent/public /BaseComponent/include /BaseComponent/source /SubComponent1/public /SubComponent1/include /SubComponent1/source /SubComponent1/SubSubComponent/public /SubComponent1/SubSubComponent/include /SubComponent1/SubSubComponent/source /SubComponent2/public /SubComponent2/include /SubComponent2/source 

I tried to make such a configuration:

 "includePath": [ ... "${workspaceRoot}", "${workspaceRoot}/*/include", "${workspaceRoot}/*/public" ], 

But that didn't seem to work. Is there a way to have only the entire title inside workspaceRoot? Something like "include the entire subfolder"?

OR another way to determine the path that depends on the project?

+8
source share
1 answer

This is not yet possible / supported, as mentioned in Microsoft/vscode-cpptools Release 849 .
An example context illustrating this problem:

includePath does not seem to work with NuGet packages since the directory name includes the version.
For example, if we use package rapidjson 1.0. 2 and later updates, we will have to update the links to " packages/rapidjson.1.0.2/build/native/include " in this file - in addition to any packages.config files.
It would be nice if we could use wildcards in directory qualifiers or some other means so as not to support the same information in two different places .

Thus, an alternative is to create a script that can generate a configuration file by updating the IncludePath section IncludePath all found include folders.


Note. number 849 is actually a duplicate of number 723 that says ( Bob Brown from Microsoft ):

The middle wildcard is not currently supported.

I created a branch that would support this some time ago , but I forgot what state it was in, and now the branch is outdated.
If someone wants to return it to synchronization with the master and complete it, we can consider accepting it.
I will open this problem again since the initial request was not actually considered.

0
source

Source: https://habr.com/ru/post/1270582/


All Articles