[PATCH] D133968: [clangd] Enable standard library index by default.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 21:46:45 PDT 2022


This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG79ed24eea37f: [clangd] Enable standard library index by default. (authored by sammccall).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133968/new/

https://reviews.llvm.org/D133968

Files:
  clang-tools-extra/clangd/Config.h
  clang-tools-extra/clangd/tool/ClangdMain.cpp


Index: clang-tools-extra/clangd/tool/ClangdMain.cpp
===================================================================
--- clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -360,6 +360,7 @@
     cat(Misc),
     desc("Abbreviation for -input-style=delimited -pretty -sync "
          "-enable-test-scheme -enable-config=0 -log=verbose -crash-pragmas. "
+         "Also sets config options: Index.StandardLibrary=false. "
          "Intended to simplify lit tests"),
     init(false),
     Hidden,
@@ -697,6 +698,9 @@
         C.Index.Background = *BGPolicy;
       if (AllScopesCompletion.getNumOccurrences())
         C.Completion.AllScopes = AllScopesCompletion;
+
+      if (Test)
+        C.Index.StandardLibrary = false;
       return true;
     };
   }
Index: clang-tools-extra/clangd/Config.h
===================================================================
--- clang-tools-extra/clangd/Config.h
+++ clang-tools-extra/clangd/Config.h
@@ -85,7 +85,7 @@
     /// Whether this TU should be background-indexed.
     BackgroundPolicy Background = BackgroundPolicy::Build;
     ExternalIndexSpec External;
-    bool StandardLibrary = false;
+    bool StandardLibrary = true;
   } Index;
 
   enum UnusedIncludesPolicy { Strict, None };


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133968.466253.patch
Type: text/x-patch
Size: 1287 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221008/a8b718ae/attachment-0001.bin>


More information about the cfe-commits mailing list