From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filippo Argiolas Newsgroups: gmane.emacs.devel Subject: Re: eglot-cthier.el --- show call hierarchy with Eglot (formally called eglot-hierarchy) Date: Wed, 11 Dec 2024 13:14:04 +0100 Message-ID: References: <43440606-4506-41c2-a608-18a910376d8e@gmx.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12208"; mail-complaints-to="usenet@ciao.gmane.io" To: Harald Kirsch , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 11 13:15:01 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tLLcK-00031C-7D for ged-emacs-devel@m.gmane-mx.org; Wed, 11 Dec 2024 13:15:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLLbZ-0001sG-2C; Wed, 11 Dec 2024 07:14:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLLbW-0001rz-Lc for emacs-devel@gnu.org; Wed, 11 Dec 2024 07:14:10 -0500 Original-Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLLbU-0005PG-Jc for emacs-devel@gnu.org; Wed, 11 Dec 2024 07:14:10 -0500 Original-Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-434a766b475so63762495e9.1 for ; Wed, 11 Dec 2024 04:14:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733919246; x=1734524046; darn=gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :from:to:cc:subject:date:message-id:reply-to; bh=/DFVMfnJXHTipu4EFOtss9LN5dFvGEGiBvijhB4H6A8=; b=GCJdHxH+O+GvunounmFEzBuwvvL5L6vu+//9yA0W7LP3w4vLQoHmOWLbk3o+CYorAo p+cjNsFHTwE0eXDY3IBDtHWZthXT2Ht9DkWbkPGiV0mc2Ekqjv+T5wYMNiA3qm9xyn/U e7j98JRq8Xl06KU5aLZG+RLtnMvwATXbjHrY9QL0/oN69EaoZP10L+x5+0n/scTRePGo G4n8s6oeJRCmSZX299jBl077J5yQWieaObmXmLi2RpyGSoo/Q4iTl8OQgZsS+PjYJ9Vm sGLOWoOVmkRJ1zU2aBVX+sO78TgWwq9me4mr1Mc2FLKxZSqA3rdOgMNqGajXcUlO5Ooj gjSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733919246; x=1734524046; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/DFVMfnJXHTipu4EFOtss9LN5dFvGEGiBvijhB4H6A8=; b=FqVIdsv8emfiN5VkqF28OCCl1lWA2V0ir0lHXPEsD5+bMhWvZ9xmENqBEsBVTw1hIm MIzqPiPxm4qvNWU9xw+EYgUv0Jew9uEP1KVoDoqe1MdvSfnS+LA/2yqBmuoqqmoOR37i Ie+LmesC0Erie7lP8Tv2D/Nj0w7tZopduZErEGTwmMnfzPJOd2/lNQ/J4VarS9cHAZhE X/f+SOVgupCySfA7lz/XAC79pCy/swlU0/YyIeSAp9uWbQEjHhzO/FkZQY2dmTRVlqQ+ KfT+ETb4UI/lBU0FSwrI3co5yJ2fPvsLsdPb7IdzTCjZAHWTdO7WrDubD+qiozsrz3Hv 4zew== X-Forwarded-Encrypted: i=1; AJvYcCXzKH7kC4A05eXXaaXu1Ij5gdr+rNshL31Da4BT/d/J9mu+35rhlRIdfEHF4wtRLI8W1FKPo1xTg2p9hg==@gnu.org X-Gm-Message-State: AOJu0YxsxxWA/akK4ePFkyW0v8homujZYz1XGgnPiRnI6dfmff13KSrh iokheYA/R/XNNnTe2ECxbb7v+ij51YnohWPx68yKi6+xjZN89GNsml/cIoYr X-Gm-Gg: ASbGnctSWyKNeL8zrsPuqBYtZocuUv1XE4x8+yeNANMXrAGo3Hk9lBdvou6V5vrHK5A 8b8+FJ3jvbxcBTtRAzNbSnf3/XJhcsznKcqhPoFmA/+zLbcl6wT8v+Aa8QHikWLK7Mr3dwIg/Pb vqZDjt6zIgHmYO08+ZVWjtaPCn28M3SvWVFxJ69CopOqrW5DIEGa24leh6f7O58VHjI4W6PsOOq lQL3IOPn4StDtXEj6WxlgReDSyf/OUc55/nafzgv/TpFPsqE53Hu2bBVPXoQtY= X-Google-Smtp-Source: AGHT+IHSpYn/u86NAOjTwCBb/S63wl4ALb17lRvwV63oy4LlJAMhA9YT2BKqMNcLWQrFdilfH2c65w== X-Received: by 2002:a05:600c:198c:b0:434:ff30:a159 with SMTP id 5b1f17b1804b1-4361c2b6b14mr21313375e9.0.1733919246144; Wed, 11 Dec 2024 04:14:06 -0800 (PST) Original-Received: from mba ([151.81.188.252]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4361ec75410sm11874855e9.1.2024.12.11.04.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2024 04:14:05 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=filippo.argiolas@gmail.com; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326345 Archived-At: Harald Kirsch writes: > Hi Filippo. > > On 11.12.24 07:05, Filippo Argiolas wrote: >> Harald Kirsch 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!