From 6164ea1d75385b6fc3c19e5ab9bb686298436a5a Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 14 Oct 2011 15:31:08 +0000 Subject: Added clang_getCompletionAnnotation and clang_getCompletionNumAnnotations to retrieve annotations from completion string. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141953 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaCodeComplete.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/Sema/SemaCodeComplete.cpp') diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 56b351c4cf..405d626ae9 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -2424,6 +2424,12 @@ CodeCompletionResult::CreateCodeCompletionString(Sema &S, Result.AddTextChunk("::"); return Result.TakeString(); } + + for (Decl::attr_iterator i = ND->attr_begin(); i != ND->attr_end(); ++i) { + if (AnnotateAttr *Attr = dyn_cast_or_null(*i)) { + Result.AddAnnotation(Result.getAllocator().CopyString(Attr->getAnnotation())); + } + } AddResultTypeChunk(S.Context, Policy, ND, Result); -- cgit v1.2.3