emacs-devel
[Top][All Lists]
Advanced

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

Re: eglot-cthier.el --- show call hierarchy with Eglot (formally called


From: Filippo Argiolas
Subject: Re: eglot-cthier.el --- show call hierarchy with Eglot (formally called eglot-hierarchy)
Date: Wed, 11 Dec 2024 13:14:04 +0100

Harald Kirsch <pifpafpuf@gmx.de> writes:

> Hi Filippo.
>
> On 11.12.24 07:05, Filippo Argiolas wrote:
>> Harald Kirsch <pifpafpuf@gmx.de> writes:
>>
>>> This shows a call hierarchy as a foldable tree, unfolded on demand.
>>>
>>> Through nice feedback here, on codeberg and on @HaraldKi@nrw.social, it
>>> got a significant update with bug fixes, enhancements and code improvements.
>>>
>>> I test this with eglipse-jdts (Java) and tsc (TypeScript).
>>>
>>> https://codeberg.org/harald/eglot-supplements#call-hierarchy
>>>
>>> Feedback welcome.
>>
>> Thanks Harald, love it!
>>
>> Seems to work with clangd too if you want to add it to the list of
>> supported servers. Let me know if you want me to test something
>> specific.
>
> A major pain point was buffer/window/frame handling. If you want to get
> creative, messing with the window/frames of the hierarchy and the source
> code to see what fails would be nice.

Will play with it a little and let you know if I find anything!

>> How about an option to unfold the tree by default? I was testing on a
>> small project, probably it gets quite bigger on large projects and
>> it's better to leave it folded?
>
> I have no recursion-test yet. In any case I would probably add a custom
> variable for the max depth to unfold initially. (Classic shift of
> responsibility to the user :-) But this should not be difficult.
>
> https://codeberg.org/harald/eglot-supplements/issues/11
>

Right, I didn't think about recursion and didn't realize the tree is
built as you traverse it. A max depth limit sounds like a nice solution :-)


>> Not sure if it's a clangd thing, I noticed that when I request the call
>> hierarchy on anything other than a function call or declaration I get a
>> "Error running timer: (args-out-of-range [] 0)". Maybe it could be
>> handled more nicely? Not sure it's something to notify the user about,
>> guess silently doing nothing would be fine.
>
> Hmmpf, I thought I had this fixed. But server's seem to be creative of
> how to provide a null result. I'll check and may contact you again for
> details or a test.
>
> https://codeberg.org/harald/eglot-supplements/issues/17
> https://codeberg.org/harald/eglot-supplements/issues/15

Thanks will follow the issues there. Feel free to contact me anytime.

>> Also, when I get to a leaf in the tree it shows with the '+' prefix,
>> when expanded it becomes '-' but there is nothing to expand so it just
>> changes the prefix. Maybe the leaf nodes should be made non-expandable?
>
> Indeed. But: nodes are only expanded on demand, so on first try, there
> is no easy way around. But clearly, once known, the leaf node should be
> distinguished.
>
> https://codeberg.org/harald/eglot-supplements/issues/16

Understood, for some reason in my mind all the tree was built at once
and represented as collapsed. Now current behaviour makes more sense!




reply via email to

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