You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C/C++ Extension Version: Version 0.21.0 January 23, 2019
Other extensions you installed (and if the issue persists after disabling them):
A clear and concise description of what the bug is: Current version of cpptools ignores the compileCommands attribute so that header files could not be found and IntelliSense falls back to tag parser. But the same config works in the previous version of cpptools.
To Reproduce
Below configs are generalized to omit project details, but kept accurate folder structures.
Here is the c_cpp_properties.json for the previous version of cpptools:
After upgrading to current version of cpptools, above config does NOT work. Header files could not be found properly by showing errors like "cannot open source file ..." and "#include errors detected. Consider updating your compile_commands.json or includePath. IntelliSense features for this translation unit (/home/bob/proj/foo/bar.cc) will be provided by the Tag Parser."
After update c_cpp_properties.json to below, the errors disappear.
But second version of c_cpp_properties.json does NOT contain "compileCommands" so that first version is better than second version because compile_commands.json provides the most accurate information.
So expected behavior is to at least make first version of c_cpp_properties.json works.
A better way is to define a clear support for the project by using custom tool chain. Define what attribute should be provided in the c_cpp_properties.json so that many similar issues related to custom tool chain could be resolved.
Type: LanguageService
Describe the bug
Ubuntu 18.04.1 LTSVersion 0.21.0 January 23, 2019cpptoolsignores thecompileCommandsattribute so that header files could not be found and IntelliSense falls back to tag parser. But the same config works in the previous version ofcpptools.To Reproduce
c_cpp_properties.jsonfor the previous version ofcpptools:{ "configurations": [ { "name": "Linux", "compileCommands": "${workspaceFolder}/compile_commands.json", "includePath": [ "${workspaceFolder}/**" ], "defines": [], "compilerPath": "/home/bob/toolchain/bin/g++ --sysroot=/home/bob/toolchain", "cStandard": "c11", "cppStandard": "c++14", "intelliSenseMode": "gcc-x64" } ], "version": 4 }compile_commands.jsoncontains a lot of entries like below.[ { "directory": "/home/bob/proj/foo", "command": "ccache g++ -I/home/bob/proj -std=c++14 -D__FOO_BAR__ -Wall -Werror --sysroot /home/bob/toolchain -o CMakeFiles/foo.dir/bar.cc.o -c /home/bob/proj/foo/bar.cc", "file": "/home/bob/proj/foo/bar.cc" }, { "...": "..." } ]cpptools, above config does NOT work. Header files could not be found properly by showing errors like"cannot open source file ..."and"#include errors detected. Consider updating your compile_commands.json or includePath. IntelliSense features for this translation unit (/home/bob/proj/foo/bar.cc) will be provided by the Tag Parser."c_cpp_properties.jsonto below, the errors disappear.{ "configurations": [ { "name": "Linux", "includePath": [ "${workspaceFolder}/**", "/home/bob/toolchain/include/**" ], "defines": [], "compilerPath": "/home/bob/toolchain/bin/g++ --sysroot=/home/bob/toolchain", "cStandard": "c11", "cppStandard": "c++14", "intelliSenseMode": "gcc-x64" } ], "version": 4 }Expected behavior
c_cpp_properties.jsondoes NOT contain"compileCommands"so that first version is better than second version becausecompile_commands.jsonprovides the most accurate information.c_cpp_properties.jsonworks.c_cpp_properties.jsonso that many similar issues related to custom tool chain could be resolved.