[clangd] Add ObjC method support to prepareCallHierarchy
authorSheldon Neuberger <sneuberger@snapchat.com>
Thu, 25 Nov 2021 10:22:56 +0000 (11:22 +0100)
committerKadir Cetinkaya <kadircet@google.com>
Thu, 25 Nov 2021 10:23:24 +0000 (11:23 +0100)
commite2cad4df22a6a411e7f7fcbc9bff0bd789545136
tree7449a10c4edcc384a6047458b5dda83383b67364
parent3a700cabdcbadb2a1a5961fd380a103cd7f867b3
[clangd] Add ObjC method support to prepareCallHierarchy

This fixes "textDocument/prepareCallHierarchy" in clangd for ObjC methods. Details at https://github.com/clangd/vscode-clangd/issues/247.

clangd uses Decl::isFunctionOrFunctionTemplate to check if the decl given in a prepareCallHierarchy request is eligible for prepareCallHierarchy. We change to use isFunctionOrMethod which includes functions and ObjC methods.

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D114058
clang-tools-extra/clangd/XRefs.cpp
clang-tools-extra/clangd/unittests/CallHierarchyTests.cpp