[clangd] Always run preamble indexing on a separate thread
authorKadir Cetinkaya <kadircet@google.com>
Tue, 18 Jul 2023 16:12:32 +0000 (18:12 +0200)
committerKadir Cetinkaya <kadircet@google.com>
Wed, 19 Jul 2023 06:48:14 +0000 (08:48 +0200)
This has been the default in our production setup for weeks now,
showing great improvements to latency and no problems around stability or
correctness of the results.

Differential Revision: https://reviews.llvm.org/D155619

clang-tools-extra/clangd/ClangdServer.cpp
clang-tools-extra/clangd/ClangdServer.h

index 1451adc..5273122 100644 (file)
@@ -94,7 +94,7 @@ struct UpdateIndexCallbacks : public ParsingCallbacks {
                              ASTCtx.getPreprocessor(), *CanonIncludes);
     };
 
-    if (Opts.AsyncPreambleIndexing && Tasks) {
+    if (Tasks) {
       Tasks->runAsync("Preamble indexing for:" + Path + Version,
                       std::move(Task));
     } else
index 88b6d2f..2bc8f02 100644 (file)
@@ -185,10 +185,6 @@ public:
     /// regions in the document.
     bool PublishInactiveRegions = false;
 
-    /// Whether to run preamble indexing asynchronously in an independent
-    /// thread.
-    bool AsyncPreambleIndexing = false;
-
     explicit operator TUScheduler::Options() const;
   };
   // Sensible default options for use in tests.