diff options
Diffstat (limited to 'include/clang/Sema/CodeCompleteConsumer.h')
-rw-r--r-- | include/clang/Sema/CodeCompleteConsumer.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/clang/Sema/CodeCompleteConsumer.h b/include/clang/Sema/CodeCompleteConsumer.h index 5db369cc13..68e07e9608 100644 --- a/include/clang/Sema/CodeCompleteConsumer.h +++ b/include/clang/Sema/CodeCompleteConsumer.h @@ -170,6 +170,18 @@ public: Result(const char *Keyword, unsigned Rank) : Kind(RK_Keyword), Keyword(Keyword), Rank(Rank), Hidden(false) { } + /// \brief Retrieve the declaration stored in this result. + NamedDecl *getDeclaration() const { + assert(Kind == RK_Declaration && "Not a declaration result"); + return Declaration; + } + + /// \brief Retrieve the keyword stored in this result. + const char *getKeyword() const { + assert(Kind == RK_Keyword && "Not a keyword result"); + return Keyword; + } + /// \brief Create a new code-completion string that describes how to insert /// this result into a program. CodeCompletionString *CreateCodeCompletionString(Sema &S); |