[clang-tools-extra] [clangd] Re-land "support outgoing calls in call hierarchy" (PR #117673)

via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 6 02:54:59 PST 2024


pidgeon777 wrote:

Hello everyone, I'm seeking clarification regarding the implementation of Outgoing Calls support.

The LSP protocol currently allows to implement two display modes for visualizing outgoing function calls:

```c
#include <stdio.h>

void function1(void) {
    printf("Executing function 1\n");
}

void function2(void) {
    printf("Executing function 2\n");
}

void function3(void) {
    printf("Executing function 3\n");
}

int main(void) {
    printf("Starting main function\n");
    function1();
    function2();
    function3();
    return 0;
}
```

For example, when querying all functions called from `main`, results could be presented in two ways:

1. Display all the called function occurrences in `main`:
   - function1()
   - function2()
   - function2()
   - function3()

2. Display the definitions of the functions called in `main`:
   - function1()
   - function2()
   - function3()

According to one of the developers, this feature should provide all the necessary data to allow the LSP client to determine the presentation method (approach 1 or 2). I previously asked about this in another thread (which I cannot locate now), and I would appreciate confirmation that this will indeed be possible with the upcoming **clangd** changes.

https://github.com/llvm/llvm-project/pull/117673


More information about the cfe-commits mailing list