diff options
-rw-r--r-- | clang-tools-extra/clangd/tool/ClangdMain.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp b/clang-tools-extra/clangd/tool/ClangdMain.cpp index 5db3d5c2306..60f1e424400 100644 --- a/clang-tools-extra/clangd/tool/ClangdMain.cpp +++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp @@ -355,8 +355,12 @@ int main(int argc, char *argv[]) { InputStyle = JSONStreamStyle::Delimited; LogLevel = Logger::Verbose; PrettyPrint = true; + // Disable background index on lit tests by default to prevent disk writes. + if (!EnableBackgroundIndex.getNumOccurrences()) + EnableBackgroundIndex = false; // Ensure background index makes progress. - BackgroundQueue::preventThreadStarvationInTests(); + else if (EnableBackgroundIndex) + BackgroundQueue::preventThreadStarvationInTests(); } if (Test || EnableTestScheme) { static URISchemeRegistry::Add<TestScheme> X( |