From 8130c88ef4576a63aebe59eba7cd8ac5ddd11d47 Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Thu, 29 May 2025 19:28:27 -0400 Subject: [PATCH] [clangd] Log the paths of loaded config files without --log=verbose Users sometimes forget about configuration they've placed in the user config file, or an ancestor directory of their project. Logging the paths of loaded config files by default (without --log=verbose) surfaces more readily where clangd is getting its configuration from. --- clang-tools-extra/clangd/ConfigYAML.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang-tools-extra/clangd/ConfigYAML.cpp b/clang-tools-extra/clangd/ConfigYAML.cpp index 47c6e1cd0f7e7..3cfbbe62046f7 100644 --- a/clang-tools-extra/clangd/ConfigYAML.cpp +++ b/clang-tools-extra/clangd/ConfigYAML.cpp @@ -6,6 +6,7 @@ // //===----------------------------------------------------------------------===// #include "ConfigFragment.h" +#include "support/Logger.h" #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" @@ -482,6 +483,7 @@ std::vector Fragment::parseYAML(llvm::StringRef YAML, DiagnosticCallback Diags) { // The YAML document may contain multiple conditional fragments. // The SourceManager is shared for all of them. + log("Loading config file at {0}", BufferName); auto SM = std::make_shared(); auto Buf = llvm::MemoryBuffer::getMemBufferCopy(YAML, BufferName); // Adapt DiagnosticCallback to function-pointer interface.