diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-02-28 17:47:14 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-02-28 17:47:14 +0000 |
commit | b98f7af5685458a00d4efd60429378efe88ad10f (patch) | |
tree | a6ee267ea5cf994691c0250921801b095de6c5d8 /lib/Sema/SemaCodeComplete.cpp | |
parent | 25e81b255cea00fe633f2822c1d1d708ef871a59 (diff) |
objective-C code completion. Property accessors may not
have their own code completion comments. Use those in
their properties in this case.
// rdar://12791315
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176271 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 2cc7b85a7f..e20330b502 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -2605,7 +2605,12 @@ CodeCompletionResult::CreateCodeCompletionString(ASTContext &Ctx, // Add documentation comment, if it exists. if (const RawComment *RC = Ctx.getRawCommentForAnyRedecl(ND)) { Result.addBriefComment(RC->getBriefText(Ctx)); - } + } + else if (const ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(ND)) + if (OMD->isPropertyAccessor()) + if (const ObjCPropertyDecl *PDecl = OMD->findPropertyDecl()) + if (const RawComment *RC = Ctx.getRawCommentForAnyRedecl(PDecl)) + Result.addBriefComment(RC->getBriefText(Ctx)); } if (StartsNestedNameSpecifier) { |