- 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
Paths
| Differential D150978
[clang][Sema] Add CodeCompletionContext::CCC_ObjCClassForwardDecl ClosedPublic Authored by dgoldman on May 19 2023, 9:08 AM.
Details Summary
Diff Detail
Event TimelineHerald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 19 2023, 9:08 AM
dgoldman marked an inline comment as done. Comment ActionsAdd a contextAllowsHeaderInsertion helper to clangd This revision is now accepted and ready to land.Jun 27 2023, 8:13 AM This revision was landed with ongoing or failed builds.Jun 27 2023, 1:27 PM Closed by commit rGa42ce094d903: [clang][Sema] Add CodeCompletionContext::CCC_ObjCClassForwardDecl (authored by dgoldman). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 535110 clang-tools-extra/clangd/CodeComplete.cpp
clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
clang/include/clang/Sema/CodeCompleteConsumer.h
clang/include/clang/Sema/Sema.h
clang/lib/Frontend/ASTUnit.cpp
clang/lib/Parse/ParseObjc.cpp
clang/lib/Sema/CodeCompleteConsumer.cpp
clang/lib/Sema/SemaCodeComplete.cpp
clang/tools/libclang/CIndexCodeCompletion.cpp
|
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).