[libclang] Expose completion result kind in `CXCompletionResult`
authorEgor Zhdan <e_zhdan@apple.com>
Mon, 31 Oct 2022 22:46:43 +0000 (15:46 -0700)
committerEgor Zhdan <e_zhdan@apple.com>
Fri, 11 Nov 2022 00:16:36 +0000 (16:16 -0800)
commit97105e5bf70fae5d9902081e917fd178b57f1717
tree69abfc900d49fe1402fc69aeb0769e7e96fc0ffc
parent48321eea9679e1d8c5a30f4027e1aa49738aebf3
[libclang] Expose completion result kind in `CXCompletionResult`

This allows clients of libclang to check whether a completion result is a keyword. Previously, keywords had `CursorKind == CXCursor_NotImplemented` and it wasn't trivial to distinguish a keyword from a pattern.

This change moves `CodeCompletionResult::ResultKind` to `clang-c` under a new name `CXCompletionResultKind`. It also tweaks `c-index-test` to print the result kind instead of `NotImplemented`, and adjusts the tests for the new output.

rdar://91852088

Differential Revision: https://reviews.llvm.org/D136844
25 files changed:
clang/include/clang-c/Index.h
clang/test/Index/arc-complete.m
clang/test/Index/code-completion.cpp
clang/test/Index/complete-at-directives.m
clang/test/Index/complete-at-exprstmt.m
clang/test/Index/complete-declarators.cpp
clang/test/Index/complete-declarators.m
clang/test/Index/complete-exprs.c
clang/test/Index/complete-exprs.cpp
clang/test/Index/complete-exprs.m
clang/test/Index/complete-lambdas.cpp
clang/test/Index/complete-lambdas.mm
clang/test/Index/complete-memfunc-cvquals.cpp
clang/test/Index/complete-method-decls.m
clang/test/Index/complete-modules.m
clang/test/Index/complete-preprocessor.m
clang/test/Index/complete-recovery.m
clang/test/Index/complete-stmt.c
clang/test/Index/complete-super.cpp
clang/test/Index/complete-synthesized.m
clang/test/Index/complete-type-factors.m
clang/tools/c-index-test/c-index-test.c
clang/tools/libclang/CIndex.cpp
clang/tools/libclang/CIndexCodeCompletion.cpp
clang/tools/libclang/libclang.map