[PATCH] D43869: [clangd] Support include canonicalization in symbol leve.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 1 01:52:37 PST 2018


hokein added inline comments.


================
Comment at: clangd/index/CanonicalIncludes.cpp:83
+  static const std::vector<std::pair<const char *, const char *>> SymbolMap = {
+      // Map symbols in <iosfwd> to their preferred includes.
+      {"std::basic_filebuf", "<fstream>"},
----------------
Looks like the list only contains stream-related symbols, there are some symbols in `<iosfwd>` not covered, is it intended? 

Maybe we keep the order of this map the same as the one listed in http://en.cppreference.com/w/cpp/header/iosfwd? That would make it easier to see the difference?


================
Comment at: unittests/clangd/SymbolCollectorTests.cpp:561
+      class no_map {};
+      class ios {};
+      class ostream {};
----------------
The STL implementation of `ios` is a typedef `typedef basic_ios<char>  ios; `, I think we should make the test align with it?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D43869





More information about the cfe-commits mailing list