This is an archive of the discontinued LLVM Phabricator instance.

[CodeCompletion] Improve completion for properties declared in Objective-C protocols
ClosedPublic

Authored by arphaman on Oct 10 2016, 9:39 AM.

Details

Summary

This patch improves code completion for properties that are declared in Objective-C protocols by making sure that properties show up in completions when they are accessed through a qualified id.

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman updated this revision to Diff 74137.Oct 10 2016, 9:39 AM
arphaman retitled this revision from to [CodeCompletion] Improve completion for properties declared in Objective-C protocols.
arphaman updated this object.
arphaman added reviewers: manmanren, doug.gregor.
arphaman set the repository for this revision to rL LLVM.
arphaman added a subscriber: cfe-commits.
manmanren edited edge metadata.Oct 10 2016, 11:22 AM

Thanks for working on this!
Manman

lib/Sema/SemaCodeComplete.cpp
3723 ↗(On Diff #74137)

I feel like the added logic belongs to here :] Both handle property reference.

The clause here handles ObjCObjectPointerType that is based on an ObjCInterfaceType. We need to handle the case where the base type is "id".

What do you think?

3756 ↗(On Diff #74137)

Can we use "auto" here?

arphaman updated this revision to Diff 74227.Oct 11 2016, 4:01 AM
arphaman edited edge metadata.
arphaman marked an inline comment as done.

The updated patch handles protocol properties together with the interface properties.

arphaman added inline comments.Oct 11 2016, 4:03 AM
lib/Sema/SemaCodeComplete.cpp
3723 ↗(On Diff #74137)

Yes, that makes sense. I updated the patch to handle properties in both the interface and qualified IDs in this body of code.

manmanren accepted this revision.Oct 11 2016, 9:33 AM
manmanren edited edge metadata.

LGTM.

Manman

This revision is now accepted and ready to land.Oct 11 2016, 9:33 AM
This revision was automatically updated to reflect the committed changes.