Skip to content

Wildcard support for includePath doesn't seem to work #13284

@danila-piatov

Description

@danila-piatov

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions