Subject: bug#78250: 31.0.50; Eglot: eglot-show-call-hierarchy

From: Gerd Möllmann <[email-masked]>
Date: Mon, 05 May 2025 05:36:39 +0200

In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.4.0) of 2025-05-04

This is in an Emacs repository, with clangd 20.1 installed via Homebrew
on macOS.

In insdel.c, navigate to function insert_and_inherit, then, on the
function name, C-u M-x eglot-show-call-hierarchy RET and choose
outgoing.

The resulting buffer looks like this:

  [-]  ∘ insert_and_inherit
   |-[+]  → chars_in_text
   |-[+]  → insert_1_both
   |-[+]  → signal_after_change
   `-[+]  → update_compositions

1. Wishlist: Expanding/collapsing nodes and jumping to call sites is not
easily reachable with the "usual" keys like TAG, RET, and so on that are
used by the profiler, Magit etc. It would be very nice if that could be
added.

2. Bug: Clicking on "chars_in_text" in the tree above takes me here:

character.c:
  586 ptrdiff_t
  587 str_as_multibyte (unsigned char *str, ptrdiff_t len, ptrdiff_t nbytes,
  588                   ptrdiff_t *nchars)
  589 {

Clicking on "insert_1_both" OTOH takes me here which is correct

insdel.c:
  581 void
  582 insert_and_inherit (const char *string, ptrdiff_t nbytes)
  583 {
  584   if (nbytes > 0)
  585     {
  586       ptrdiff_t len = chars_in_text ((unsigned char *) string, nbytes), opoint;
  587       insert_1_both (string, len, nbytes, 1, 1, 0);

Clicking on "signal_after_change" is also correct, and clicking on
update_compositions is incorrect again.

The outgoing call tree I get from eglot-supplements does all correctly.