-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.Check the Milestone for the release in which the fix is or will be available.regressionA bug that didn't exist in a previous releaseA bug that didn't exist in a previous release
Milestone
Description
Type: LanguageService
Describe the bug
- OS and Version:
Ubuntu 18.04.1 LTS - VS Code Version:
Version: 1.30.2 Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8 Date: 2019-01-07T22:49:48.319Z Electron: 2.0.12 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 OS: Linux x64 4.15.0-43-generic - 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
cpptoolsignores 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
- Below configs are generalized to omit project details, but kept accurate folder structures.
- Here is the
c_cpp_properties.jsonfor the previous version ofcpptools:and{ "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" }, { "...": "..." } ] - 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.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
- But second version of
c_cpp_properties.jsondoes NOT contain"compileCommands"so that first version is better than second version becausecompile_commands.jsonprovides the most accurate information. - So expected behavior is to at least make first version of
c_cpp_properties.jsonworks. - 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.jsonso that many similar issues related to custom tool chain could be resolved.
Metadata
Metadata
Assignees
Labels
Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.Check the Milestone for the release in which the fix is or will be available.regressionA bug that didn't exist in a previous releaseA bug that didn't exist in a previous release