Fork me on GitHub
#lsp
<
2022-12-23
>
pesterhazy09:12:42

I see that lsp-mode contains a bunch of goodies like lsp-clojure-move-form https://github.com/emacs-lsp/lsp-mode/blob/4cd7b9d4d7da45b544ab35a701bcd785dd20c2ed/clients/lsp-clojure.el#L239. Are these available via eglot? If not, what would it take to implement support for them for eglot users like me?

pesterhazy09:12:36

By the way not sure how I feel about the fact that lsp-mode contains clojure-specific code

pesterhazy09:12:48

Is there a way to expose this functionality without coupling the client code to the target language?

pesterhazy09:12:29

A lot of functionality is available via eglot-code-action, but (please correct me if I'm wrong) not all

ericdallo10:12:31

All those are custom requests and response that are not part of the LSP spec, multiple servers do that when they want a custom feature and the spec is not enough to support it yet

💡 1
ericdallo10:12:19

It needs custom code on client, and that's one of the reasons I find eglot a little bit outdated compared with lsp-mode

ericdallo10:12:14

Another example is lsp-dart which has a lot of complex handling to custom dart server messages, I really can't see one using same features with eglot unfortunately

pesterhazy10:12:10

What if there was an add-on to eglot? Could this be implemented in another package?

ericdallo11:12:26

Yep, probably eglot has functions to be extended just like lsp-mode

pesterhazy14:12:51

Gotcha, I'll take a look

ericdallo14:12:12

It should be a good oportunity to eglot provide functions or recommended ways to extend if not exists yet

👍 1
lispers-anonymous18:12:39

I wouldn't say Eglot is outdated compared to lsp-mode, it's scope is just different. Eglot aims to implement the LSP spec and nothing more. lsp-mode aims to support everything it possibly can related to lsp out of the box. I highly doubt Eglot will ever support these extension methods out of the box, they are too much of a moving target for something built into Emacs and somewhat tied to its release cycle. I think the maintainer of Eglot would say it is up to package maintainers and major-mode maintainers to implement specific extensions for relevant language servers. With that said, Eglot implements most of it's handling functions with generic methods that can be extended in separate packages. I think there is a need for eglot-clojure package at some point, especially now that Eglot is shipping with Emacs 29.

👍 1
armed09:12:53

Hi. I’m not sure is it neovim lsp bug or clojure-lsp. When I choose first option (see screenshots) it adds import, but for some other random class with the same name:

armed09:12:09

And it adds in square brackets, but parens is preferred for java imports in clojure style guide, as far as I know

armed09:12:05

and what does x 3,`x 0` means?

armed09:12:23

Log :

[clojure-lsp.handlers:246] - :document-symbol 0ms
[clojure-lsp.handlers:253] - :document-highlight 1ms
[clojure-lsp.handlers:253] - :document-highlight 0ms
[clojure-lsp.handlers:410] - :code-actions 105ms
[clojure-lsp.handlers:361] - :execute-command 66ms
[clojure-lsp.feature.file-management:241] - changes analyzed by clj-depend took 0ms
[clojure-lsp.dep-graph:269] - :maintain-dep-graph 0ms
[clojure-lsp.kondo:305] - Non-fatal error from clj-kondo: No configs copied.

[clojure-lsp.feature.file-management:237] - changes analyzed by clj-kondo took 29ms
[clojure-lsp.dep-graph:269] - :maintain-dep-graph 0ms
[clojure-lsp.server:552] - :analyze-file 29ms
[clojure-lsp.feature.file-management:139] - :reference-files/find 6ms
[clojure-lsp.feature.file-management:137] - :notify-references 6ms
[clojure-lsp.handlers:253] - :document-highlight 0ms
[clojure-lsp.handlers:246] - :document-symbol 0ms
[clojure-lsp.handlers:435] - :semantic-tokens-full 2ms - waited 143ms
[clojure-lsp.server:102] - :publish-diagnostics 0ms
[clojure-lsp.handlers:167] - :did-save 0ms
[clojure-lsp.handlers:422] - :code-lens 0ms

armed09:12:56

It works perfectly when there is only one class candidate

ericdallo10:12:10

It means the number of usages across the project

👍 1
ericdallo10:12:29

Could you create a repro so I can try?

armed10:12:47

sure, give me few mins

armed10:12:51

kept same deps.edn

ericdallo11:12:53

Thanks, I can try this soon today

🙏 1
borkdude19:12:00

> but parens is preferred for java imports in clojure style guide, as far as I know Which style guide, can you double check?

armed03:12:56

@U04V15CAJ you are right, I don’t remember where I saw that or I just misunderstood. Nothing found about parens in java imports. Sorry about that.

ericdallo16:12:47

It's a clojure-lsp bug @U34K4458X, will create a issue and fix it for next release

armed16:12:21

thank you 🙏

ericdallo16:12:44

Fixed, soon available at #C032YH7P0R2, thanks for the report

🎉 1
didibus19:12:34

Emacs 29 has adopted Eglot as its standard LSP mode. Does that affect clojure-lsp? Or it should work as-is with it?

ericdallo19:12:24

mostly everything should work ok, for find defintion install jarchive, @UDVJE9RE3 has more context

👍 2