[clang-tools-extra] [clangd][modules] Discover opened module files outside the compilation database (PR #218958)

Aleksandr Platonov via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 26 23:56:36 PDT 2026


================
@@ -942,8 +947,13 @@ void ClangdServer::outgoingCalls(
 }
 
 void ClangdServer::onFileEvent(const DidChangeWatchedFilesParams &Params) {
-  // FIXME: Do nothing for now. This will be used for indexing and potentially
-  // invalidating other caches.
+  if (!ModulesManager)
+    return;
+  bool ModulesChanged = false;
+  for (const auto &Change : Params.changes)
+    ModulesChanged |= ModulesManager->onFileEvent(Change);
+  if (ModulesChanged)
+    reparseOpenFilesIfNeeded([](PathRef) { return true; });
----------------
ArcsinX wrote:

Can you please give more details about this change. Do we need to setup file watchers on the client side to make this works?

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


More information about the cfe-commits mailing list