emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feedback request for new package: eglot-hierarchy --- show call hier


From: Gerd Möllmann
Subject: Re: feedback request for new package: eglot-hierarchy --- show call hierarchy
Date: Tue, 03 Dec 2024 15:46:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Harald Kirsch <pifpafpuf@gmx.de> writes:

> Hi all,
>
>
> https://codeberg.org/harald/eglot-supplements#call-hierarchy
>
> has eglot-hierarchy.el which talks to a language server, requests the
> call hierarchy for the item at point and shows it as a simple tree in
> another buffer.
>
> Folding/unfolding the tree elements works for showing the respective
> code or jumping to it.
>
> So far it does only incoming calls. Depending on feedback I may look
> into outgoing calls as well as type hierarchies which look quite similar.
>
> I read over https://github.com/joaotavora/eglot/issues/614 but missed
> the link to https://github.com/dolmens/eglot-hierarchy . Just tried it
> and couldn't get it to work with eclipse-jdts or Typescript, so it seems
> either package needs more work :-)
>
> Feedback welcome.
>
> Harald

Hi Harald,

I've given it a try with Emacs' C code and clangd. Installation with
straight.el, in case it's useful for others:

  (use-package eglot-supplements
    :straight (:repo "https://codeberg.org/harald/eglot-supplements.git";
                     :branch "main" :files ("*.el"))
    :init
    (provide 'eglot-supplements)
    :bind
    (:map my-eglot-bindings
          ("c" . #'eglot-hierarchy-request-call-hierarchy)))

The :bind lets me use the hierarchy in C buffers with C-c e c. The
'provide' is a workaround to prevent an error when trying to load that
"package" which doesn't have a eglot-supplements.el.

Feedback so far:

- I get a "eglot-cthier" buffer, don't like that name much.

- The hierarchy buffer has key bindings for commands with prefix 'xx-'
  defined in eglot-hierarchy.el.

- when I jump to some caller with SPC, it jumps the the line of the
  function definition, not to where the call is. Don't know if that's
  possible to implement, but I would find that much nicer.

So far so good, thanks!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]