diff options
Diffstat (limited to 'lib/Index/IndexBody.cpp')
-rw-r--r-- | lib/Index/IndexBody.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Index/IndexBody.cpp b/lib/Index/IndexBody.cpp index efa5ed85d60bb..d3632b8b9b15f 100644 --- a/lib/Index/IndexBody.cpp +++ b/lib/Index/IndexBody.cpp @@ -254,6 +254,18 @@ public: SymbolRoleSet Roles = getRolesForRef(E, Relations); return IndexCtx.handleReference(E->getExplicitProperty(), E->getLocation(), Parent, ParentDC, Roles, Relations, E); + } else if (const ObjCMethodDecl *Getter = E->getImplicitPropertyGetter()) { + // Class properties that are explicitly defined using @property + // declarations are represented implicitly as there is no ivar for class + // properties. + if (Getter->isClassMethod()) { + if (const auto *PD = Getter->getCanonicalDecl()->findPropertyDecl()) { + SmallVector<SymbolRelation, 2> Relations; + SymbolRoleSet Roles = getRolesForRef(E, Relations); + return IndexCtx.handleReference(PD, E->getLocation(), Parent, + ParentDC, Roles, Relations, E); + } + } } // No need to do a handleReference for the objc method, because there will |