This is useful when using clangd with CMake based projects in Visual Studio Code since when using CMake the compile_commands.json file is usually located in a build subdirectory which isn't a parent directory of the source files. Allowing passing relative paths to -compile-commands-dir allows specifying clangd.arguments = ["-compile-commands-dir=build"] in VSCode's settings file and having it work for each CMake based project that uses the build subdirectory as the build directory (instead of having to specify the absolute path to the compile commands directory for each separate project in VSCode's settings).
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Thanks for the fix!
clangd/tool/ClangdMain.cpp | ||
---|---|---|
261 ↗ | (On Diff #170338) | This comment echoes the code, but doesn't say *why*. |
263 ↗ | (On Diff #170338) | it's fine to call make_absolute on an absolute path, it's a no-op. |
267 ↗ | (On Diff #170338) | nit: we tend to inline this as if (std::error_code EC = sys::fs...) |
272 ↗ | (On Diff #170338) | This is a no-op (as are the existing ones on 255 and 259...) |
Comment Actions
It looks like these are your first couple of LLVM patches.
So, welcome :-) And do you want me to commit them for you?
Typically your first few patches get landed by someone else, and then you ask for commit access: https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access