[PATCH] D92494: [clangd] Bundle code completion items when the include paths differ, but resolve to the same file.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 9 01:16:15 PST 2020


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:187
+      if (auto Header = headerToInsertIfAllowed(Opts))
+        if (auto HeaderFile = toHeaderFile(*Header, FileName))
+          if (auto Spelled =
----------------
(sorry for the late drive by comment)

if this returns an error it needs to be consumed to ensure we don't crash (destructor of `Expected` asserts)

but apart from that, this introduces lots of new string manipulations for every completion item, might have bad impact on latency especially when the include paths are long and require heap allocations. something to keep in mind once this hits production (and maybe we can choose to approximate or not do it at all if it turns out to be problematic)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92494



More information about the cfe-commits mailing list