[PATCH] D150978: [clang][Sema] Add CodeCompletionContext::CCC_ObjCClassForwardDecl
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 21 01:02:43 PDT 2023
kadircet added inline comments.
================
Comment at: clang-tools-extra/clangd/CodeComplete.cpp:407
+ // reference the declaration.
+ if (ContextKind == CodeCompletionContext::CCC_ObjCClassForwardDecl)
+ ShouldInsert = false;
----------------
rather than doing this here, can you pass `ContextKind` into `headerToInsertIfAllowed` ? we already have some logic there that does something similar (e.g. check if there's a decl in the main file). it'd be nice to group them together, in case we want to extend this in the future. (it'd be great if we can just have a `contextAllowsHeaderInsertion` helper, which can only return true for ObjCClassForwardDecl for now).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150978/new/
https://reviews.llvm.org/D150978
More information about the cfe-commits
mailing list