[PATCH] D136844: [libclang] Expose completion result kind in `CXCompletionResult`

Egor Zhdan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 30 08:28:50 PDT 2022


egorzhdan added inline comments.
Herald added subscribers: Michael137, JDevlieghere.


================
Comment at: clang/include/clang/Sema/CodeCompleteConsumer.h:755
-  /// Describes the kind of result generated.
-  enum ResultKind {
-    /// Refers to a declaration.
----------------
kadircet wrote:
> i don't follow the reason for replacing this struct with `CXCompletionResultKind` and renaming occurrences in half of the codebase. can we keep this around, introduce the new enum type into `Index.h` and have `clang/tools/libclang/CIndexCodeCompletion.cpp` do the conversion from Sema type to Index type instead?
> 
> Unless I am missing some other requirement for doing so. i feel like the conceptual dependency from Sema to Index is one we should get rid of, rather than make tighter.
This was mostly done to be consistent with the way `CXCursorKind` and `CXAvailabilityKind` are declared in `Index.h` and used as fields of `CodeCompletionResult`. I think updating the enum name in a few source files shouldn't be a major problem, but I can avoid it if you feel strongly against this approach.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136844/new/

https://reviews.llvm.org/D136844



More information about the cfe-commits mailing list