This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Do not show namespace comments.
ClosedPublic

Authored by ilya-biryukov on Jun 15 2018, 3:13 AM.

Details

Summary

Comments from namespaces that clangd produces are too noisy and often
not useful.

Namespaces have too many redecls and we don't have a good way of
determining which of the comments are relevant and which should be
ignored (e.g. because they come from code generators like the protobuf
compiler).

Diff Detail

Repository
rL LLVM

Event Timeline

ilya-biryukov created this revision.Jun 15 2018, 3:13 AM
sammccall accepted this revision.Jun 17 2018, 11:37 PM
sammccall added inline comments.
clangd/CodeCompletionStrings.cpp
172 ↗(On Diff #151481)

while here, should this be if (Result.Declaration)? I make this mistake a lot...

177 ↗(On Diff #151481)

nit: canRequestComment looks a little expensive, hoist above that?

This revision is now accepted and ready to land.Jun 17 2018, 11:37 PM
ilya-biryukov marked an inline comment as done.
  • Move the namespace check to happen before canRequestComment call
ilya-biryukov added inline comments.Jun 27 2018, 2:51 AM
clangd/CodeCompletionStrings.cpp
172 ↗(On Diff #151481)

Looking at the FIXME above, it seems we might show a different comment from the one returned by clang's code completion.
I'll double-check if we do the right thing there and will try to do if (!Result.Declaration) in a follow-up patch.

This revision was automatically updated to reflect the committed changes.