Fork me on GitHub
#clj-kondo
<
2019-12-18
>
borkdude17:12:32

@ericdallo Maybe you could provide some docs how to set this up as part of https://github.com/borkdude/clj-kondo/blob/master/doc/editor-integration.md, if you like

ericdallo18:12:59

totally, one thing that we should do, its package a binary for the lsp-server, like clojure-lsp already does(https://github.com/snoe/clojure-lsp/releases), which this, we only need to point to this binary on the lsp-mode configuration and I can provide some docs how to do it. I don't know if we can run the lsp-server on lsp-mode from a jar, (I tried with no success :/) , maybe yes if we change lsp-mode here(https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-clojure.el#L141) allowing one more lsp for clojure, the clj-kondo, like the docs recommend here(https://github.com/emacs-lsp/lsp-mode#registering-server). What you think @borkdude?

borkdude19:12:02

@ericdallo What about just documenting what you did: make a wrapper script that calls java -jar ... and register that wrapper script with lsp-mode?

borkdude19:12:11

It may not seem optimal, but for now it might be the best we have, and we can make it more polished if more people start using this?

ericdallo19:12:51

Yeah, i think its a good start, i will write the docs and open the PR 🙂

borkdude19:12:08

registering "java -jar ..." directly with lsp-mode didn't work?

ericdallo22:12:51

it was my first try, but it didn't work, but i tested again pointing to the full path of the jar (not *~/*the/path/to/jar) and worked! I guess a documentation on clj-kondo.lsp's README teaching just to set the lsp-clojure-server-command to run a java -jar ... its good enough partywombat

borkdude22:12:04

Yeah, or in the editor integration like there are docs for IntelliJ

ericdallo22:12:36

Maybe on both, what do you think?

borkdude22:12:44

I think it makes sense to include it in the clj-kondo repo and then I could link to it from the .lsp repo

ericdallo22:12:49

Thanks @borkdude, I will try to use clj-kondo as a lsp server on emacs, and I can report the issues/improvements later

borkdude22:12:51

Thank you very much

ericdallo23:12:28

@borkdude Do you know if its hard to start implementing lsp features on clj-kondo.lsp like rename, references and completion, similar how clojure-lsp (https://github.com/snoe/clojure-lsp/blob/943188e7c64e2a5d635e8f3424feb67a34f0bc79/src/clojure_lsp/main.clj#L120) does? I think that clj-kondo is awesome and powerful, with these lsp features, it would be wonderful! I would like to help implement, but i don't know how hard is and how to debug/test this as I implement? (PS: i don't know how LSP works, i know that its a message channel that expect specific headers and other things). I'm studyng lsp4j, that i saw that you used to work with LSP. I hope I can help in some way

borkdude10:12:30

Interesting idea. I'd like to make/see a tool that can both be used with the binary and the LSP server. There are some ideas for this here: Once this is there, as a JVM lib, it can be hooked up to the LSP server as well https://github.com/borkdude/clj-kondo/issues/253

borkdude10:12:13

> This tool could potentially also fix some warnings by rewriting code. Maybe there has to be a separate issue for it btw.

ericdallo12:12:28

It looks like a good idea, i know that LSP has the code actions feature, where you can do some action at point, insert some code or replace a existent by something you choose, like create getters, setters and constructor in java. I think LSP can help with these