Open paulzhn opened 1 year ago
Can you please run "C/C++: Log Diagnostics" and share the results with us?
It looks like that Cmake is not sending any configuration.
Can you please run "C/C++: Log Diagnostics" and share the results with us?
-------- Diagnostics - 12/3/2022, 2:45:13 PM
Version: 1.12.4
Current Configuration:
{
"name": "Linux",
"includePath": [
"${workspaceFolder}",
"/usr/src/linux-headers-5.15.0-52-generic/include"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"intelliSenseMode": "linux-gcc-x64",
"configurationProvider": "ms-vscode.cmake-tools",
"compilerPathIsExplicit": true,
"cStandardIsExplicit": false,
"cppStandardIsExplicit": false,
"intelliSenseModeIsExplicit": true,
"mergeConfigurations": false,
"browse": {
"path": [
"${workspaceFolder}",
"/usr/src/linux-headers-5.15.0-52-generic/include"
],
"limitSymbolsToIncludedHeaders": true
}
}
Custom browse configuration:
{
"browsePath": [
"/home/xieyun/code/agent-libs/build/CMakeFiles",
"/home/xieyun/code/agent-libs/build/b64-prefix/src/b64-stamp",
"/home/xieyun/code/agent-libs/build/c-ares-prefix/src/c-ares-stamp",
"/home/xieyun/code/agent-libs/build/curl-prefix/src/curl-stamp",
"/home/xieyun/code/agent-libs/build/driver/CMakeFiles",
"/home/xieyun/code/agent-libs/build/libsinsp/CMakeFiles",
"/home/xieyun/code/agent-libs/build/grpc-prefix/src/grpc-stamp",
"/home/xieyun/code/agent-libs/build/jq-prefix/src/jq-stamp",
"/home/xieyun/code/agent-libs/build/openssl-prefix/src/openssl-stamp",
"/home/xieyun/code/agent-libs/build/protobuf-prefix/src/protobuf-stamp",
"/home/xieyun/code/agent-libs/build/libsinsp/test/CMakeFiles",
"/home/xieyun/code/agent-libs/common",
"/home/xieyun/code/agent-libs/build/zlib-prefix/src/zlib",
"/home/xieyun/code/agent-libs/build/driver/src",
"/home/xieyun/code/agent-libs/userspace/libscap",
"/home/xieyun/code/agent-libs/driver",
"/home/xieyun/code/agent-libs/userspace/common",
"/home/xieyun/code/agent-libs/userspace/libscap/examples/01-open",
"/home/xieyun/code/agent-libs/userspace/libscap/examples/02-validatebuffer",
"/home/xieyun/code/agent-libs/build/tbb-prefix/src/tbb/include",
"/home/xieyun/code/agent-libs/build/b64-prefix/src/b64/include",
"/home/xieyun/code/agent-libs/build/jq-prefix/src/jq/target/include",
"/home/xieyun/code/agent-libs/userspace/libsinsp/third-party/jsoncpp",
"/home/xieyun/code/agent-libs/build/c-ares-prefix/src/c-ares/target/include",
"/home/xieyun/code/agent-libs/build/openssl-prefix/src/openssl/include",
"/home/xieyun/code/agent-libs/build/curl-prefix/src/curl/include",
"/home/xieyun/code/agent-libs/userspace/libsinsp",
"/home/xieyun/code/agent-libs/userspace/async",
"/home/xieyun/code/agent-libs/userspace/libsinsp/include",
"/home/xieyun/code/agent-libs/build/protobuf-prefix/src/protobuf/target/include",
"/home/xieyun/code/agent-libs/build/grpc-prefix/src/grpc/target/include",
"/home/xieyun/code/agent-libs/build/grpc-prefix/src/grpc/third_party/abseil-cpp",
"/home/xieyun/code/agent-libs/build/libsinsp",
"/home/xieyun/code/agent-libs/userspace/libsinsp/container_engine",
"/home/xieyun/code/agent-libs/userspace/libsinsp/container_engine/docker",
"/home/xieyun/code/agent-libs/userspace",
"/home/xieyun/code/agent-libs/userspace/libsinsp/examples",
"/home/xieyun/code/agent-libs/build/tbb-prefix/src/tbb-stamp",
"/home/xieyun/code/agent-libs/build/googletest-src/googletest/include/gtest",
"/home/xieyun/code/agent-libs/build/googletest-src/googletest/include",
"/home/xieyun/code/agent-libs/build/googletest-src/googletest",
"/home/xieyun/code/agent-libs/userspace/libsinsp/test",
"/home/xieyun/code/agent-libs/build/libscap/CMakeFiles",
"/home/xieyun/code/agent-libs/build/zlib-prefix/src/zlib-stamp",
"/home/xieyun/code/agent-libs/build/googletest-src/googlemock/include",
"/home/xieyun/code/agent-libs/build/googletest-src/googlemock",
"/home/xieyun/code/agent-libs/build/googletest-src/googlemock/src",
"/home/xieyun/code/agent-libs/build/googletest-src/googletest/src"
],
"compilerPath": "/usr/bin/g++",
"compilerArgs": [],
"compilerFragments": [
" -Wall -ggdb -std=c++0x -D_DEBUG",
"-Wall -Wshadow -Wno-error=dangling-else -DGTEST_HAS_PTHREAD=1 -fexceptions -Wextra -Wno-unused-parameter -Wno-missing-field-initializers"
]
}
No active translation units.
------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 3891
Number of files parsed: 164
FYI, the project is https://github.com/KindlingProject/agent-libs with the branch of kindling-dev
Thanks for sharing the project!
When I generate this project, CMake doesn't tell us about the files in the driver folder so we can't create a configuration for main.c
etc. The problem seems to be that when you use include
with modules and have those modules define targets, CMake doesn't write the source file configurations to the json files that we read from. As a result, we don't know how to configure IntelliSense and we don't give cpptools any information about the file.
I think you'll need to open an issue asking Kitware to include the source file configurations in what they call the "CMake File API". Once that is working, our extension will be able to provide the configurations. You can open a request here: https://gitlab.kitware.com/cmake/cmake/-/issues
@paulzhn any update on the upstream issue ?
Brief Issue Summary
The error squiggle exists on the first line of every .c file and it shows the hint "language modes specified are incompatible". At first, I thought the problem was from cpp-tools, however after I changed
configurationProvider
toNone
, the problem had gone.I found an issue with cpp-tools https://github.com/microsoft/vscode-cpptools/issues/9684, and it said the problem was that configurationProvider sends the wrong command to cpp-tools. So maybe the problem is from cmake-tools?
CMake Tools Diagnostics
Debug Log
Additional Information
The c_cpp_properties.json: