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 /include/clang/Sema/CodeCompleteConsumer.h | |
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 'include/clang/Sema/CodeCompleteConsumer.h')
-rw-r--r-- | include/clang/Sema/CodeCompleteConsumer.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/include/clang/Sema/CodeCompleteConsumer.h b/include/clang/Sema/CodeCompleteConsumer.h index a20468e20b..9e2d60d3e0 100644 --- a/include/clang/Sema/CodeCompleteConsumer.h +++ b/include/clang/Sema/CodeCompleteConsumer.h @@ -428,19 +428,23 @@ public: private: /// \brief The number of chunks stored in this string. - unsigned NumChunks; + unsigned NumChunks : 16; + /// \brief The number of annotations for this code-completion result. + unsigned NumAnnotations : 16; + /// \brief The priority of this code-completion string. unsigned Priority : 30; /// \brief The availability of this code-completion result. unsigned Availability : 2; - + CodeCompletionString(const CodeCompletionString &); // DO NOT IMPLEMENT CodeCompletionString &operator=(const CodeCompletionString &); // DITTO CodeCompletionString(const Chunk *Chunks, unsigned NumChunks, - unsigned Priority, CXAvailabilityKind Availability); + unsigned Priority, CXAvailabilityKind Availability, + const char **Annotations, unsigned NumAnnotations); ~CodeCompletionString() { } friend class CodeCompletionBuilder; @@ -464,8 +468,14 @@ public: /// \brief Retrieve the priority of this code completion result. unsigned getPriority() const { return Priority; } - /// \brief Reteirve the availability of this code completion result. + /// \brief Retrieve the availability of this code completion result. unsigned getAvailability() const { return Availability; } + + /// \brief Retrieve the number of annotations for this code completion result. + unsigned getAnnotationCount() const; + + /// \brief Retrieve the annotation string specified by \c AnnotationNr. + const char *getAnnotation(unsigned AnnotationNr) const; /// \brief Retrieve a string representation of the code completion string, /// which is mainly useful for debugging. @@ -504,6 +514,8 @@ private: /// \brief The chunks stored in this string. SmallVector<Chunk, 4> Chunks; + + SmallVector<const char *, 2> Annotations; public: CodeCompletionBuilder(CodeCompletionAllocator &Allocator) @@ -560,6 +572,8 @@ public: /// \brief Add a new chunk. void AddChunk(Chunk C) { Chunks.push_back(C); } + + void AddAnnotation(const char *A) { Annotations.push_back(A); } }; /// \brief Captures a result of code completion. |