Revert "[clangd] Remove unused private field 'Opts' in UpdateIndexCallbacks (NFC)"
authorKadir Cetinkaya <kadircet@google.com>
Wed, 19 Jul 2023 08:45:06 +0000 (10:45 +0200)
committerKadir Cetinkaya <kadircet@google.com>
Wed, 19 Jul 2023 08:45:23 +0000 (10:45 +0200)
This reverts commit c4fa97fca7e92c736fcb09779c84b42c25ffae70.

clang-tools-extra/clangd/ClangdServer.cpp

index cbcc902..1451adc 100644 (file)
@@ -67,10 +67,11 @@ struct UpdateIndexCallbacks : public ParsingCallbacks {
   UpdateIndexCallbacks(FileIndex *FIndex,
                        ClangdServer::Callbacks *ServerCallbacks,
                        const ThreadsafeFS &TFS, AsyncTaskRunner *Tasks,
-                       bool CollectInactiveRegions)
+                       bool CollectInactiveRegions,
+                       const ClangdServer::Options &Opts)
       : FIndex(FIndex), ServerCallbacks(ServerCallbacks),
         TFS(TFS), Stdlib{std::make_shared<StdLibSet>()}, Tasks(Tasks),
-        CollectInactiveRegions(CollectInactiveRegions) {}
+        CollectInactiveRegions(CollectInactiveRegions), Opts(Opts) {}
 
   void onPreambleAST(
       PathRef Path, llvm::StringRef Version, CapturedASTCtx ASTCtx,
@@ -163,6 +164,7 @@ private:
   std::shared_ptr<StdLibSet> Stdlib;
   AsyncTaskRunner *Tasks;
   bool CollectInactiveRegions;
+  const ClangdServer::Options &Opts;
 };
 
 class DraftStoreFS : public ThreadsafeFS {
@@ -227,7 +229,7 @@ ClangdServer::ClangdServer(const GlobalCompilationDatabase &CDB,
                         std::make_unique<UpdateIndexCallbacks>(
                             DynamicIdx.get(), Callbacks, TFS,
                             IndexTasks ? &*IndexTasks : nullptr,
-                            PublishInactiveRegions));
+                            PublishInactiveRegions, Opts));
   // Adds an index to the stack, at higher priority than existing indexes.
   auto AddIndex = [&](SymbolIndex *Idx) {
     if (this->Index != nullptr) {