You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem I am encountering is that when I try to follow the links in the includes using clangd, I get redirected to the bazel-out directory instead of the actual project files.
The generated compile-commands.json includes the following flags:
Question:
Is there a way to configure Bazel or clangd to get the includes to point to the actual project files instead of the bazel-out directory? Or am I missing something in my setup?
The text was updated successfully, but these errors were encountered:
My understanding is that bazel always uses _virtual_includes because that is how it prunes the files that can be included to only the ones you define in your hdrs, and this tool is just returning the path that bazel uses. Theoretically these files are just symlinks to the originals, so at least with my testing in neovim with clangd something in the chain is smart enough to just open the actual file, resolving all the symlinks. If I saw more issues with this I would be tempted to post-process the json file to remap these in the way I "know" works. In the case you use include_prefix on cc_library this would be more complicated, but just using includes or strip_include_prefix it could probably be 1:1
From clangd/clangd#544 it seems like the --path-mappings feature may be somewhat viable. I wonder if we could get these to be extracted and placed somewhere we could use?
I am setting up a Bazel build system and integrating clangd into my development workflow. My project structure is as follows:
My BUILD file for the main executable looks like this:
The problem I am encountering is that when I try to follow the links in the includes using clangd, I get redirected to the bazel-out directory instead of the actual project files.
The generated compile-commands.json includes the following flags:
I would expect the include paths to point to the actual files in my project, like this:
Question:
Is there a way to configure Bazel or clangd to get the includes to point to the actual project files instead of the bazel-out directory? Or am I missing something in my setup?
The text was updated successfully, but these errors were encountered: