all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* feedback request for new package: eglot-hierarchy --- show call hierarchy
@ 2024-12-03 11:49 Harald Kirsch
  2024-12-03 14:46 ` Gerd Möllmann
  0 siblings, 1 reply; 2+ messages in thread
From: Harald Kirsch @ 2024-12-03 11:49 UTC (permalink / raw)
  To: emacs-devel

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

--
HaraldKi@nrw.social




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: feedback request for new package: eglot-hierarchy --- show call hierarchy
  2024-12-03 11:49 feedback request for new package: eglot-hierarchy --- show call hierarchy Harald Kirsch
@ 2024-12-03 14:46 ` Gerd Möllmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Möllmann @ 2024-12-03 14:46 UTC (permalink / raw)
  To: Harald Kirsch; +Cc: emacs-devel

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!





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-03 14:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-03 11:49 feedback request for new package: eglot-hierarchy --- show call hierarchy Harald Kirsch
2024-12-03 14:46 ` Gerd Möllmann

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.