diff options
author | Vassil Vassilev <v.g.vassilev@gmail.com> | 2016-07-27 14:56:59 +0000 |
---|---|---|
committer | Vassil Vassilev <v.g.vassilev@gmail.com> | 2016-07-27 14:56:59 +0000 |
commit | 0ed81cd54f68489de539f5f2f832e6a88c7a1a32 (patch) | |
tree | ad26ed625644f94466c38dd0e902b1547b4be450 /include/clang/Lex/Preprocessor.h | |
parent | 3f38d952361bac197787c9160b6a532cff6a6bc5 (diff) |
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
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r-- | include/clang/Lex/Preprocessor.h | 16 |
1 files changed, 16 insertions, 0 deletions
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<Preprocessor> { /// \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; } |