diff options
author | Erik Verbruggen <erikjv@me.com> | 2011-10-14 15:31:08 +0000 |
---|---|---|
committer | Erik Verbruggen <erikjv@me.com> | 2011-10-14 15:31:08 +0000 |
commit | 6164ea1d75385b6fc3c19e5ab9bb686298436a5a (patch) | |
tree | 93408352a553eb9fecd58404f4a18ff5676988a8 /tools/libclang/CIndexCodeCompletion.cpp | |
parent | 3a919e7110407ae7609bb6edc57aac16a5990661 (diff) |
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
Diffstat (limited to 'tools/libclang/CIndexCodeCompletion.cpp')
-rw-r--r-- | tools/libclang/CIndexCodeCompletion.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/libclang/CIndexCodeCompletion.cpp b/tools/libclang/CIndexCodeCompletion.cpp index 3ce0d245cf..c19b340492 100644 --- a/tools/libclang/CIndexCodeCompletion.cpp +++ b/tools/libclang/CIndexCodeCompletion.cpp @@ -203,6 +203,20 @@ clang_getCompletionAvailability(CXCompletionString completion_string) { : CXAvailability_Available; } +unsigned clang_getCompletionNumAnnotations(CXCompletionString completion_string) +{ + CodeCompletionString *CCStr = (CodeCompletionString *)completion_string; + return CCStr ? CCStr->getAnnotationCount() : 0; +} + +CXString clang_getCompletionAnnotation(CXCompletionString completion_string, + unsigned annotation_number) { + CodeCompletionString *CCStr = (CodeCompletionString *)completion_string; + return CCStr ? createCXString(CCStr->getAnnotation(annotation_number)) + : createCXString((const char *) 0); +} + + /// \brief The CXCodeCompleteResults structure we allocate internally; /// the client only sees the initial CXCodeCompleteResults structure. struct AllocatedCXCodeCompleteResults : public CXCodeCompleteResults { |