[PATCH] D41823: [clangd] Add more filters for collected symbols.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 10 05:22:15 PST 2018


hokein accepted this revision.
hokein added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: clangd/index/SymbolCollector.h:20
 
-// Collect all symbols from an AST.
-//
-// Clients (e.g. clangd) can use SymbolCollector together with
-// index::indexTopLevelDecls to retrieve all symbols when the source file is
-// changed.
+/// \brief Collect all symbols from an AST.
+///
----------------
We should also document what kinds of symbols we are collecting, since this patch has changed the behavior (only collect top-level symbols).


================
Comment at: unittests/clangd/SymbolCollectorTests.cpp:165
+TEST_F(SymbolCollectorTest, IgnoreSymbolsInMainFile) {
+  const std::string Header = R"(
+    class Foo {};
----------------
nit: although the default value is false, I'd explicitly specify `CollectorOpts.IndexMainFiles = false;` (readers don't need to jump to another file to see the default value).


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D41823





More information about the cfe-commits mailing list