[PATCH] D51291: [clangd] Support multiple #include headers in one symbol.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 31 06:36:55 PDT 2018

sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.

Comment at: clangd/CodeComplete.cpp:396
+    // Prefer includes that do not need edits (i.e. already exist).
+    std::stable_sort(Completion.Includes.begin(), Completion.Includes.end(),
+                     [](const CodeCompletion::IncludeCandidate &LHS,
nit: this could be std::stable_partition. Not sure if faster, but maybe clearer.

Comment at: clangd/CodeComplete.h:145
+  // All possible include headers ranked by preference. By default, the first
+  // include is used.
+  llvm::SmallVector<IncludeCandidate, 1> Includes;
if we've bundled together overloads that have different sets of providing headers, these includes may not be accurate for all of them. Maybe comment this limitation?

  rCTE Clang Tools Extra


More information about the cfe-commits mailing list