diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-03-22 17:55:27 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-03-22 17:55:27 +0000 |
commit | 1fcf4921afd73214f45847a3fdfcb625461f1715 (patch) | |
tree | 6720b28a31e5f79910ad29f2460c1cc9320c26f1 /clang/lib | |
parent | c56ae1b677b31fe978bdac240a60923cd74d81a8 (diff) | |
download | bcm5719-llvm-1fcf4921afd73214f45847a3fdfcb625461f1715.tar.gz bcm5719-llvm-1fcf4921afd73214f45847a3fdfcb625461f1715.zip |
documentation parsing. Provide code completion comment
for self.GetterName where GetterName is the getter method
for a property with name different from the property name
(declared via a property getter attribute) // rdar://12791315
llvm-svn: 177744
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index 6bb954315ab..1cb264265aa 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -2541,6 +2541,20 @@ CodeCompletionResult::CreateCodeCompletionString(ASTContext &Ctx, if (Declaration) { Result.addParentContext(Declaration->getDeclContext()); Pattern->ParentName = Result.getParentName(); + // Provide code completion comment for self.GetterName where + // GetterName is the getter method for a property with name + // different from the property name (declared via a property + // getter attribute. + const NamedDecl *ND = Declaration; + if (const ObjCMethodDecl *M = dyn_cast<ObjCMethodDecl>(ND)) + if (M->isPropertyAccessor()) + if (const ObjCPropertyDecl *PDecl = M->findPropertyDecl()) + if (PDecl->getGetterName() == M->getSelector() && + PDecl->getIdentifier() != M->getIdentifier()) + if (const RawComment *RC = Ctx.getRawCommentForAnyRedecl(PDecl)) { + Result.addBriefComment(RC->getBriefText(Ctx)); + Pattern->BriefComment = Result.getBriefComment(); + } } return Pattern; |