-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Currently ${workspaceRoot} is implicitly included in the includePath, and is recursively searched for header files.
This causes problems in projects which have files with the same name in different paths. For example:
base/string16.h
ui/string16.h
third_party/somelibrary/base/string16.h
Now when a file does #include "base/string16.h", VS Code finds all three of the string16.h headers, and the indexer gets confused about which one to use (it seems to default to ui/string16.h since that has the shortest path?). There are two problems here:
-
It's presumably a bug that the indexer matches
ui/string16.hwhen you#include "base/string16.h"? -
Finding both
base/string16.handthird_party/somelibrary/base/string16.his a more fundamental issue though. It may be possible to heuristically address this by preferring exact matches that don't require recursion, or preferring shorter paths. But for a robust solution there probably needs to be a way to disable the implicit recursive search of${workspaceRoot}for includes. I tried adding an explicit includePath of"${workspaceRoot}/*"since the tooltip suggests specifying '*' to indicate non-recursive search, but that didn't seem to make any difference (presumably because includePath is in addition to the implicit workspace search, and/or because${workspaceRoot}expansion wasn't yet supported?).
VS Code version: 1.10.0-insider
cpptools version: 0.10.0
OS: Ubuntu 14.04