-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extension opens system header instead of project header #4411
Comments
Are you using Go to Def on the Otherwise, can you run C/C++: Log Diagnostics and look what the includePath is being used and see if the paths are correct? |
I use it on https://github.com/gcc-mirror/gcc/blob/gcc-9_2_0-release/libiberty/obstack.c#L92
|
Your includePath doesn't include any workspace folder path. What is your workspace folder? The "${workspaceFolder}/**" will only recursively find headers that are under that path -- is the header in a parent path of the workspace folder? |
Hi @sean-mcmanus i don't really understand what you are saying. You say my includePath doesn't include a workspace folder path. But i see in the logs:
I was assuming that The header file is located here |
Does your compiler exist in the If it does, you should change the |
There are no binaries distributed along with the source code of gcc. See https://github.com/gcc-mirror/gcc/tree/gcc-9_2_0-release |
Thanks for the update. This is one of the tricky corner cases we face when we find includes with duplicate names. You should be able to set priority on your local copy of the includes by adding
|
Thanks @bobbrow that fixed it. May i note that this is not very intuitive, imo project files should get priority. The issue can be closed if wontfix. Or leave open to change priority of include files and/or add help information about this. |
Closing this as the user's issue is addressed, and the behavior is currently by design. We improved the logging when multiple headers with the same name are encountered. |
Type: LanguageService
Describe the bug
I opened this folder in vscode
/home/flip111/spksrc/distrib/gcc-9.2.0
. I saw that this folder was created/home/flip111/spksrc/distrib/gcc-9.2.0/.vscode
.When i look at the file
/home/flip111/spksrc/distrib/gcc-9.2.0/libiberty/obstack.c
i go to a symbol press F12 and it opens the file/usr/include/obstack.h
.I expect it to open
/home/flip111/spksrc/distrib/gcc-9.2.0/include/obstack.h
.In the configuration GUI the includePath is set to
${workspaceFolder}/**
, compiler configured to/usr/bin/clang
It's my first time using vscode, i don't understand why it prefers to open my system header instead of the project header.
The text was updated successfully, but these errors were encountered: