[all-commits] [llvm/llvm-project] 97105e: [libclang] Expose completion result kind in `CXCom...

Egor Zhdan via All-commits all-commits at lists.llvm.org
Thu Nov 10 16:16:52 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 97105e5bf70fae5d9902081e917fd178b57f1717
      https://github.com/llvm/llvm-project/commit/97105e5bf70fae5d9902081e917fd178b57f1717
  Author: Egor Zhdan <e_zhdan at apple.com>
  Date:   2022-11-10 (Thu, 10 Nov 2022)

  Changed paths:
    M clang/include/clang-c/Index.h
    M clang/test/Index/arc-complete.m
    M clang/test/Index/code-completion.cpp
    M clang/test/Index/complete-at-directives.m
    M clang/test/Index/complete-at-exprstmt.m
    M clang/test/Index/complete-declarators.cpp
    M clang/test/Index/complete-declarators.m
    M clang/test/Index/complete-exprs.c
    M clang/test/Index/complete-exprs.cpp
    M clang/test/Index/complete-exprs.m
    M clang/test/Index/complete-lambdas.cpp
    M clang/test/Index/complete-lambdas.mm
    M clang/test/Index/complete-memfunc-cvquals.cpp
    M clang/test/Index/complete-method-decls.m
    M clang/test/Index/complete-modules.m
    M clang/test/Index/complete-preprocessor.m
    M clang/test/Index/complete-recovery.m
    M clang/test/Index/complete-stmt.c
    M clang/test/Index/complete-super.cpp
    M clang/test/Index/complete-synthesized.m
    M clang/test/Index/complete-type-factors.m
    M clang/tools/c-index-test/c-index-test.c
    M clang/tools/libclang/CIndex.cpp
    M clang/tools/libclang/CIndexCodeCompletion.cpp
    M clang/tools/libclang/libclang.map

  Log Message:
  -----------
  [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




More information about the All-commits mailing list