Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
danila-piatov opened this issue Feb 15, 2025 · 0 comments
Open

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

danila-piatov opened this issue Feb 15, 2025 · 0 comments

Comments

@danila-piatov
Copy link

danila-piatov commented Feb 15, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant