vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Wildcard support for includePath doesn't seem to work

Open danila-piatov opened this issue 9 months ago • 0 comments

Environment

  • OS and Version: Mac OS, latest
  • VS Code Version: Version: 1.97.2
  • C/C++ Extension Version: 1.23.6

Bug Summary and Steps to Reproduce

I've created a new toy Bazel project and added Absel as an external dependency. Bazel can build the project OK.

However, when I open my main.cc file in VSCode, the editor says it doesn't recognize the abseil-specific includes.

My .vscode/c_cpp_properties.json contains the following record (possibly added by the Bazel plugin):

      "includePath": [
        "${workspaceFolder}/**"  // This doesn't work.
      ],

So it's supposed to find bazel-downloaded libs, but doesn't.

When I enter the correct path to the Abseil dependency manually, VSCode handles the includes correctly:

      "includePath": [
        "${workspaceFolder}/bazel-LU/external/abseil-cpp~"  // This works.
      ],

Could this be due to ${workspaceFolder}/bazel-LU being a symlink to a under under /tmp? Probably not because this has been the case since at least 2021: https://discuss.elastic.co/t/bazel-build-artifacts-stored-in-tmp-by-default/281814.

Configuration and Logs

Here is my `c_cpp_properties.json`. 


{
  "version": 4,
  "configurations": [
    {
      "name": "Mac",
      "includePath": [
        "${workspaceFolder}/bazel-LU/external/abseil-cpp~",
        "${workspaceFolder}/bazel-LU/external/googletest~/googletest/include"
      ],
      "defines": [],
      "macFrameworkPath": [
        "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
      ],
      "compilerPath": "/usr/bin/clang",
      "cppStandard": "c++23",
      "intelliSenseMode": "macos-clang-arm64"
    }
  ]
}

Other Extensions

No response

Additional context

No response

danila-piatov avatar Feb 15 '25 00:02 danila-piatov