[PATCH] D43462: [clangd] Fixes for #include insertion.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 19 07:42:10 PST 2018


sammccall added inline comments.


================
Comment at: clangd/Headers.cpp:42-43
 };
 
+/// Returns true if \p Path has header extensions like .h and .hpp etc.
+bool hasHeaderExtension(PathRef Path) {
----------------
As discussed offline, this seems dubious.
- this is probably the generalization of '.inc' handling, and so probably wants the include stack and belongs at indexing time (we're determining "what's the public header for this symbol, or is the symbol private")?
 - as discussed offline, it seems like we can sidestep this whole problem by not indexing symbols only visible in main files, for now
(later we'll want a flag on the symbol for whether it's public, so we can support find-symbol-by-name for mainfile-declared symbols)


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D43462





More information about the cfe-commits mailing list