Closed xubury closed 4 years ago
Here's the log
Hi @xubury . It looks like the only standard C++ header being included is iostream. And, it looks like "std" is not being squiggled, so appears to have been defined. Could you try adding the following to your PCH, to see if it addresses the squiggles on string, ifstream, and stringstream?
#include <string>
#include <fstream>
#include <sstream>
@Colengms hi, i add the headers you suggested to pch but the problems still remain. Also, not just string ifstream, and stringstream are being squiggled, other stuffs declared in other headers also report missing though I have no error compiling.
The issue is that we don't handle "-include" in compilerArgs, because we expect users to use our forcedInclude property instead to set this. The original intent of compilerArgs was simply for arguments that affect system includes and defines. This is the 2nd report of user using "-include" instead of "forcedInclude" so we could use this issue to track adding that "redundant" support as a feature request to avoid other people hitting this.
@xubury Are you able to use forcedInclude to workaround the issue?
Oh...since the CMake Tools configuration provider is being used. It looks like this could be considered a bug with that -- it should be converting the -include to our forcedInclude setting.
It doesn't seem like specifying the forcedInclude property will work if the configuration provider is used. It's possible switching to setting compileCommands instead of configurationProvider might work (but you might hit other bugs with compileCommands).
@xubury I believe this issue will be addressed by changes in 0.29.0 for https://github.com/microsoft/vscode-cpptools/issues/5512
Yes, I no longer have this issue in 0.29.0-insiders.
Type: LanguageService
Describe the bug
To Reproduce Use -include compile option for a header file using gcc , then #include that header file again in a cpp file.
Expected behavior That header file was considered , but not handled correctly by the intellisense engine, i guess? You can see from the screenshot, _PCH_H was already defined. So pch.h had been included, but in the cpp file it is considered not included?
Screenshots
Additional context