diff options
author | David Goldman <davg@google.com> | 2023-06-27 14:16:13 -0400 |
---|---|---|
committer | David Goldman <davg@google.com> | 2023-06-27 16:25:40 -0400 |
commit | a42ce094d90341f88a845740b2e5783060f23e3e (patch) | |
tree | d4b72a2d04353147f1e29a9f48a988c101f66143 /clang/lib/Frontend/ASTUnit.cpp | |
parent | 9fdde69f72f6145d220645d1b218b4c6f2be2c13 (diff) | |
download | llvm-a42ce094d90341f88a845740b2e5783060f23e3e.zip llvm-a42ce094d90341f88a845740b2e5783060f23e3e.tar.gz llvm-a42ce094d90341f88a845740b2e5783060f23e3e.tar.bz2 |
[clang][Sema] Add CodeCompletionContext::CCC_ObjCClassForwardDecl
- Use this new context in Sema to limit completions to seen ObjC class
names
- Use this new context in clangd to disable include insertions when
completing ObjC forward decls
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D150978
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index a42df66..f6a74fc 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -322,6 +322,7 @@ static uint64_t getDeclShowContexts(const NamedDecl *ND, if (ID->getDefinition()) Contexts |= (1LL << CodeCompletionContext::CCC_Expression); Contexts |= (1LL << CodeCompletionContext::CCC_ObjCInterfaceName); + Contexts |= (1LL << CodeCompletionContext::CCC_ObjCClassForwardDecl); } // Deal with tag names. @@ -2028,6 +2029,7 @@ static void CalculateHiddenNames(const CodeCompletionContext &Context, case CodeCompletionContext::CCC_IncludedFile: case CodeCompletionContext::CCC_Attribute: case CodeCompletionContext::CCC_NewName: + case CodeCompletionContext::CCC_ObjCClassForwardDecl: // We're looking for nothing, or we're looking for names that cannot // be hidden. return; |