This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Dont index ObjCCategoryDecls for completion
ClosedPublic

Authored by kadircet on Jun 18 2021, 8:26 AM.

Details

Summary

They are already provided by Sema, deserializing from preamble if need
be. Moreover category names are meaningless outside interface/implementation
context, hence they were only causing noise.

Diff Detail

Event Timeline

kadircet created this revision.Jun 18 2021, 8:26 AM
kadircet requested review of this revision.Jun 18 2021, 8:26 AM
dgoldman added inline comments.Jun 18 2021, 8:35 AM
clang-tools-extra/clangd/CodeComplete.cpp
1918

Seems like we should also ignore ObjCCategoryImplDecl, I think those would have the same issue (although only from other .m files in the project, not from SDK headers)?

kadircet updated this revision to Diff 353658.Jun 22 2021, 8:22 AM
kadircet marked an inline comment as done.
  • Also handle ObjcCategoryImplDecl
clang-tools-extra/clangd/CodeComplete.cpp
1918

we actually never index those, as symbolcollector canonicalizes ObjcCategoryImplDecls to ObjcCategoryDecl, so we can't really test it. but adding here for completeness.

dgoldman accepted this revision.Jun 22 2021, 10:23 AM
This revision is now accepted and ready to land.Jun 22 2021, 10:23 AM
This revision was automatically updated to reflect the committed changes.