diff options
author | Haojian Wu <hokein@google.com> | 2018-01-17 14:29:25 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2018-01-17 14:29:25 +0000 |
commit | 2ac973d583e7355d705239310c720fb03593bcdd (patch) | |
tree | 58f2d8221aa458fd6037bacff8092a619c6d3bab /lib/Sema/SemaLookup.cpp | |
parent | 614f5c2b1bdf24b24845d8be274b3bdb448cc37f (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 'lib/Sema/SemaLookup.cpp')
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 157d090490..7e7eac38c1 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -3507,6 +3507,8 @@ static void LookupVisibleDecls(DeclContext *Ctx, LookupResult &Result, if (Visited.visitedContext(Ctx->getPrimaryContext())) return; + Consumer.EnteredContext(Ctx); + // Outside C++, lookup results for the TU live on identifiers. if (isa<TranslationUnitDecl>(Ctx) && !Result.getSema().getLangOpts().CPlusPlus) { |