Skip to content
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

Multiple definitions shown for header/include file but only one is on includePath #4186

Closed
smcpeak opened this issue Sep 3, 2019 · 2 comments

Comments

@smcpeak
Copy link

smcpeak commented Sep 3, 2019

Type: LanguageService

I am using VSCode 1.37.1 with CppTools 0.25.1 on Windows with mingw64-5.4.0. I have followed the VSCode C++ configuration tutorial at https://code.visualstudio.com/docs/cpp/config-mingw but I have a problem resolving header file locations. In the code editor, if I put the cursor on "<iostream>", then press F12, I go to that file. But if I put the cursor on "<vector>" and press F12, I get a little "peek" pop-up showing three different possible resolutions. See screenshot below.

VSCode has already detected the correct include paths, and the correct file only exists in one of them, so it should already have all of the required information. Therefore, I expect VSCode to simply go to the proper file, and think it is a bug that instead it prompts me to make a choice.

I believe the only steps necessary to reproduce this are to follow the tutorial up to the Exploring IntelliSense step, then put the cursor on "<vector>" and press F12.

I have already used "C/C++: Reset IntelliSense Database"; the symptom described is as it happens right after a reset.

I asked about this on Stack Overflow a few days ago but no one has answered.

I searched for existing bugs on this topic. The only one I found is Issue #3461, but that was solved by resetting the database, and my problem is not.

I normally have several other extensions running, but I have confirmed that the symptom happens with only the CppTools extension enabled.

Screenshot:

Screenshot of VSCode popup with multiple definitions

By using the "C/C++: Log Diagnostics" palette command, I see that VSCode has detected the proper include paths (comparing to "g++ -v empty.c" at a command prompt). The complete diagnostics are: cpp-diagnostics.txt.

I also enabled logging for the language server. That log is: debug-log.txt

@sean-mcmanus
Copy link
Contributor

Yes, Go to Def on #include doesn't use the includePath currently. We're tracking this with #2564 .

@sean-mcmanus
Copy link
Contributor

@github-actions github-actions bot locked and limited conversation to collaborators Oct 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants