[PATCH] D46751: [clangd] Filter out private proto symbols in SymbolCollector.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 16 05:04:10 PDT 2018


ilya-biryukov added inline comments.


================
Comment at: clangd/ClangdLSPServer.cpp:274
         WorkspaceEdit WE;
         WE.changes = {{Params.textDocument.uri.uri(), Edits}};
         reply(WE);
----------------
NIT: not related to this change, but maybe use `std::move(Edits)` to avoid extra copies.


================
Comment at: clangd/index/SymbolCollector.cpp:127
+  // will include OUTER_INNER and exclude some_enum_constant.
+  return (ND.getKind() != Decl::EnumConstant) ||
+         std::any_of(Name.begin(), Name.end(), islower);
----------------
The heuristrics that rely on naming style seem too fragile.
More thorough heuristics should do better, but are more complicated.
Maybe we could leave a fixme saying that these can be improved in case we'll run into problems. WDYT?


================
Comment at: unittests/clangd/SymbolCollectorTests.cpp:711
+           };
+           bool operator<(int x, int y);
+         })";
----------------
Could you give an intuition on why is this considered private?
We don't filter out those operators from other headers, right? Why are proto headers special?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D46751





More information about the cfe-commits mailing list