diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-03-23 01:10:45 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-03-23 01:10:45 +0000 |
commit | 168613735dce8103ef78390ac28786b5a278f439 (patch) | |
tree | d6467f09ad0ee9e2a6f25a7f3b47ba4162c57db6 /lib/Sema/SemaCodeComplete.cpp | |
parent | b095782ec09329b474a4e0d0ccdad4c15d515b39 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 1cb264265a..34c83edcde 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -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; |