Author: Nathan Ridge
Date: 2025-05-30T22:31:12-04:00
New Revision: ed14e0da77e3ab6f66ea51f07c1ac6bbf06df113

URL: 
https://github.com/llvm/llvm-project/commit/ed14e0da77e3ab6f66ea51f07c1ac6bbf06df113
DIFF: 
https://github.com/llvm/llvm-project/commit/ed14e0da77e3ab6f66ea51f07c1ac6bbf06df113.diff

LOG: [clangd] Log the paths of loaded config files without --log=verbose 
(#142063)

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.

Added: 
    

Modified: 
    clang-tools-extra/clangd/ConfigYAML.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/ConfigYAML.cpp 
b/clang-tools-extra/clangd/ConfigYAML.cpp
index ff457d8701307..6086357d8f0d9 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"
@@ -486,6 +487,7 @@ std::vector<Fragment> 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<llvm::SourceMgr>();
   auto Buf = llvm::MemoryBuffer::getMemBufferCopy(YAML, BufferName);
   // Adapt DiagnosticCallback to function-pointer interface.


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to