[clang-tools-extra] Add --project-root to clangd (PR #155905)

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 29 22:32:12 PST 2025


================
@@ -460,6 +462,17 @@ DirectoryBasedGlobalCompilationDatabase::lookupCDB(
   return Result;
 }
 
+void DirectoryBasedGlobalCompilationDatabase::Options::applyWorkingDirectory(
+    const std::optional<std::string> &&WorkingDirectory) {
+  if (WorkingDirectory)
+    this->WorkingDirectory = *WorkingDirectory;
+  else {
+    SmallString<256> CWD;
----------------
HighCommander4 wrote:

I could go either way on this. The advantage of a fallback is that it can help workaround a client that's unhelpfully failing to set `rootUri`, for which you as a user may not have much other recourse.

https://github.com/llvm/llvm-project/pull/155905


More information about the cfe-commits mailing list