summaryrefslogtreecommitdiffstats
path: root/include/clang/Sema/Lookup.h
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2018-01-17 14:29:25 +0000
committerHaojian Wu <hokein@google.com>2018-01-17 14:29:25 +0000
commit2ac973d583e7355d705239310c720fb03593bcdd (patch)
tree58f2d8221aa458fd6037bacff8092a619c6d3bab /include/clang/Sema/Lookup.h
parent614f5c2b1bdf24b24845d8be274b3bdb448cc37f (diff)
[Sema] Add visited contexts to CodeCompleteContext
Summary: This would allow code completion clients to know which context is visited during Sema code completion. Also some changes: * add `EnteredContext` callback in VisibleDeclConsumer. * add a simple unittest for sema code completion (only for visited contexts at the moment). Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: mgorny, bkramer, cfe-commits Differential Revision: https://reviews.llvm.org/D42071 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@322661 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/Lookup.h')
-rw-r--r--include/clang/Sema/Lookup.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/Sema/Lookup.h b/include/clang/Sema/Lookup.h
index 546df8842a..0e8dcada74 100644
--- a/include/clang/Sema/Lookup.h
+++ b/include/clang/Sema/Lookup.h
@@ -784,6 +784,12 @@ public:
/// class of the context we searched.
virtual void FoundDecl(NamedDecl *ND, NamedDecl *Hiding, DeclContext *Ctx,
bool InBaseClass) = 0;
+
+ /// \brief Callback to inform the client that Sema entered into a new context
+ /// to find a visible declaration.
+ //
+ /// \param Ctx the context which Sema entered.
+ virtual void EnteredContext(DeclContext *Ctx) {}
};
/// \brief A class for storing results from argument-dependent lookup.