documentation parsing: when providing code completion comment

for a getter used in property-dot syntax, if geter has its own
comment use it. // rdar://12791315

llvm-svn: 177797
This commit is contained in:
Fariborz Jahanian
2013-03-23 01:10:45 +00:00
parent 4d96c8d714
commit be8bc67b66
2 changed files with 29 additions and 2 deletions

View File

@@ -2550,11 +2550,18 @@ CodeCompletionResult::CreateCodeCompletionString(ASTContext &Ctx,
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)) {
PDecl->getIdentifier() != M->getIdentifier()) {
if (const RawComment *RC =
Ctx.getRawCommentForAnyRedecl(M)) {
Result.addBriefComment(RC->getBriefText(Ctx));
Pattern->BriefComment = Result.getBriefComment();
}
else if (const RawComment *RC =
Ctx.getRawCommentForAnyRedecl(PDecl)) {
Result.addBriefComment(RC->getBriefText(Ctx));
Pattern->BriefComment = Result.getBriefComment();
}
}
}
return Pattern;