This is an archive of the discontinued LLVM Phabricator instance.

[clangd][ObjC] Fix ObjC method definition completion
ClosedPublic

Authored by dgoldman on Jun 29 2022, 7:06 AM.

Details

Summary

D124637 improved filtering of method expressions, but not method
definitions. With this change, clangd will now filter ObjC method
definition completions based on their entire selector instead of
only the first selector fragment.

Diff Detail

Event Timeline

dgoldman created this revision.Jun 29 2022, 7:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2022, 7:06 AM
dgoldman requested review of this revision.Jun 29 2022, 7:06 AM
sammccall accepted this revision.Jun 29 2022, 7:34 AM

Ah, this is subtle. Thanks!

clang-tools-extra/clangd/CodeComplete.cpp
864

weirdly, codeCompletionString(Result) looks like it would mutate Result and then return a pattern with the same chunks (but different extra fields). So not affect the result of this function, but possibly others as a side-effect.

(e.g. add BriefComment and ParentName in the case that there's a pattern + declaration, as there is here)

What you have is fine, but if you feel like digging deeper codeCompletionString(Result) may be either better or worse here!

This revision is now accepted and ready to land.Jun 29 2022, 7:34 AM
dgoldman added inline comments.Jun 29 2022, 12:58 PM
clang-tools-extra/clangd/CodeComplete.cpp
864

Hmm from what I can tell, it appears those are unused by clangd, but for posterity I can swap it over

dgoldman updated this revision to Diff 441685.Jul 1 2022, 7:00 AM
  • Use codeCompletionString(Result) for RK_Pattern
dgoldman marked an inline comment as done.Jul 1 2022, 7:01 AM
This revision was landed with ongoing or failed builds.Jul 1 2022, 7:06 AM
This revision was automatically updated to reflect the committed changes.