-
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
Can not Go to Definition/Parameter hinting for stdlib.h functions #578
Comments
The definition is at /usr/include/c++/4.2.1/cstdlib, so opening that file should fix this, but we're still investigating why the file is sometimes not parsed automatically from the stdlib.h. There is no existing issue for this. It couldn't get a repro on 10.11.6, but I got repro on 10.12.3. |
Okay, I got the repro on 10.11.6 too. The bug is caused by the fact that /usr/include/stdlib.h is being parsed instead of /usr/include/c++/4.2.1/tr1/stdlib.h . The file that isn't parsed has the #include to cstdlib, which contains the definition. Changing limitSymbolsToIncludedHeaders to false is a workaround. If we took the "tr1/" into account or parsed every matching file instead of the 1st match, that would fix this issue (or just set limitSymbolsToIncludedHeaders to false by default). |
For what it's worth, I'm working with C and not C++ code, so I would assume I want /usr/include/stdlib.h, and not /usr/include/c++/4.2.1/tr1/stdlib.h, but I'll defer to you. |
That's good to know. Yeah, I thought you were using C++, so we have an additional problem then. The /usr/include/stdlib.h is being parsed, but it's not correctly picking up any of the symbols in the file. If I delete stuff in the file I can get symbols to be found, so there's something in the file that is causing our parser to fail. In the past this has been caused by macros. We'll investigate a fix... |
It's a problem with the attributes at the end of the exit definition. You can work around this via opening cpp.hint in /.vscode/extension/ms-vscode.cpptools-<version>/" and adding #define lines for all the attributes at the end of the definitions. We might be able to ship a fix with today's update. Let me know if we need to add more things to the list (I'm pretty sure we're missing stuff):
Oh, and then you'll need to delete or rename your .browse.vc.db (or whatever you set your databaseFilename to). |
fopen() was the only other I noticed (which I overlooked before, and leading to incorrect detail about only Intellisense parameter info for stdlib.h definitions), which adds |
Ah, thanks, I missed that one. We'll fix that (either in the soon to be released update or the next one). |
Fixed with 0.10.5 for stdlib/stdio. We have a backlog item for investigating other standard headers which have similar problems with custom attributes. |
VSCode: 1.10.2
cpptools: 0.10.4
MacOS: 10.12.3
I've noticed there's a lot of similar issues for this, but a lot of them are confounded. Sorry in advance if there's an existing issue I should follow instead.
When I try to right click on a function in stdlib.h and select "Go to Definition", I get a tooltip-like error that no definition was found. "Go To Definition" with a function in stdio.h has expected behavior.
However, if I "Go to Definition" on
#include <stdlib.h>
, I'm given a choice between/usr/include/c++/4.2.1/tr1/stdlib.h
and/usr/include/stdlib.h
. Maybe this contributes/causes the issue.STR
exit()
.The text was updated successfully, but these errors were encountered: