From 0ed81cd54f68489de539f5f2f832e6a88c7a1a32 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Wed, 27 Jul 2016 14:56:59 +0000 Subject: Implement filtering for code completion of identifiers. Patch by Cristina Cristescu and Axel Naumann! Agreed on post commit review (D17820). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276878 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Lex/Preprocessor.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/clang/Lex/Preprocessor.h') diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 30cc37f6f8..c9b712504e 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -265,6 +265,10 @@ class Preprocessor : public RefCountedBase { /// \brief True if we hit the code-completion point. bool CodeCompletionReached; + /// \brief The code completion token containing the information + /// on the stem that is to be code completed. + IdentifierInfo *CodeCompletionII; + /// \brief The directory that the main file should be considered to occupy, /// if it does not correspond to a real file (as happens when building a /// module). @@ -984,6 +988,18 @@ public: /// completion point. void CodeCompleteNaturalLanguage(); + /// \brief Set the code completion token for filtering purposes. + void setCodeCompletionIdentifierInfo(IdentifierInfo *Filter) { + CodeCompletionII = Filter; + } + + /// \brief Get the code completion token for filtering purposes. + StringRef getCodeCompletionFilter() { + if (CodeCompletionII) + return CodeCompletionII->getName(); + return {}; + } + /// \brief Retrieve the preprocessing record, or NULL if there is no /// preprocessing record. PreprocessingRecord *getPreprocessingRecord() const { return Record; } -- cgit v1.2.3