Fork me on GitHub
#lsp
<
2024-02-05
>
Felipe14:02:27

little documentation update for the call hierarchy tutorial section: https://github.com/emacs-lsp/lsp-mode/pull/4324

ericdallo14:02:02

Thank you! :merged:

Noah Bogart15:02:15

I have implemented the Project Tree view in coc-clojure (release forthcoming), and I have some thoughts on its design. Whatโ€™s the best method of relating those to yโ€™all?

ericdallo15:02:37

nice! would you mind share a print later?

ericdallo15:02:07

I implemented it for emacs so feel free to ask here

Noah Bogart15:02:42

what do you mean "print"?

ericdallo15:02:02

screenshot ๐Ÿ˜…

Noah Bogart15:02:46

the two thoughts i have are: 1) can there be a :node-type on the returned nodes? typescript doesn't handle open maps as well as clojure, so having a more obvious method of "this is a branch, that is a leaf" would be helpful. 2) is it possible to send the whole tree at once? on a small project, it's not so bad to open each item one by one, but on a big one, it feels onerous to have to click through everything.

ericdallo15:02:26

1. I'd like to avoid that as there are other LSP methods/responses that you can infer the type only with the given fields, but if that's critical to make the feature work on nvim, I think we could add 2. I'd like to avoid that as well ๐Ÿ˜…, that's something the client should support, for example on emacs treemacs there is a option to treemacs open each child until no more child exists and that works great for some features. Since this is a feature that can load lots of info, it's good to be lazy like call hierarchy

Noah Bogart15:02:51

A "node type" isn't necessary, it would just be helpful/useful. Otherwise, I have to be slightly more verbose in my checking (to help the type checker).

๐Ÿ‘ 1
Noah Bogart15:02:33

and makes sense about the lazy perspective. i'll experiment with a setting to allow for calling recursively, see how slow that is. (thankfully, clojure-lsp is returning results in sub 1ms on my 2018 laptop, so i don't think that'll be the issue here)

ericdallo15:02:56

yeah, the problem is more related with the json traffic, clojure-lsp is indeed very fast after startup ๐Ÿ’… , but communicating via JSON LSP logs all the ns, functions, java classes and jars of a project, can take a lot for medium/big projects

๐Ÿ‘ 1
Noah Bogart15:02:12

Example of coc-clojure's Project Tree impl

๐ŸŽ‰ 5
ericdallo15:02:39

Looks awesome!

Noah Bogart15:02:30

yeah it's very cool! the coc.nvim docs aren't great, but now that I understand how it works, I hope to get this working for the test tree and for the call heirarchy as well.

๐ŸŽ‰ 1
David G22:02:43

Am I doing something wrong? I try to rename a ns using , r r on the ns name, want to move it from core/db.clj to lib/db.clj but when I run the command and rename it to lib.db it kills all the aliased requires. I.e. if something was [core.db :as db] it becomes [lib.db (doesn't retain the alias nor the syntax)

ericdallo01:02:03

Is that using latest clojure-lsp? Is there a code repro I can try?

David G01:02:31

Not sure how to get the clojure lsp version don't see it in the`pkg-info-package-version` list. Let me get a quick example to use

David G01:02:23

Can't reproduce with a simple project. I did notice it worked once, but not anymore. Unfortunately can't share the code where it does fail. Probably best to ignore for now