Fork me on GitHub

I'd like to use the clj-kondo in lsp mode on spacemacs (reason: graal doesn't compile to armv8 yet). There is documentation on how to use clj-kondo in vanilla emacs here and documentation on the lsp layer config in spacemacs here . I am too much of a newbie to put these pieces together. Has anyone done this before?


I would be interested to hear if anyone has a Language Server Protocol setup for Clojure too. I would like to understand how it benefits the development workflow, beyond doing some of the CIDER functions without using a REPL. I always run the REPL, so have never understood what I missing. As most language don't have a tool like CIDER, it easy to see the added benefit for them. It's curious that some have suggested using clj-kondo as the basis of a Clojure language server protocol server.


@jr0cket The reason clj-kondo has an LSP server originates in support for VSCode and poor Windows support in the beginning.


Now you can install a clj-kondo extension in VSCode that doesn't need any external installation of a binary as long as you have Java installed


But later on some people also started using the LSP server for IntelliJ, Emacs and Sublime


The clj-kondo LSP server only gives diagnostic and no other IDE functionality


@borkdude Okay, that's interesting, thanks. So if I have clj-kondo giving me live feedback on my code as I type (via flycheck in Emacs) it that the same information as I get from LSP? It seems like there is a little more (otherwise why use it other than not having to run a repl). Maybe I should just read up on this more, it's all a bit vague to me. Thanks.


exactly the same

👍 4

the main use case for LSP for clj-kondo is that some environments cannot run the binary, such as armv8, see the question above


Personally, it seems like REPL abrogates the need for LSP, since REPL does the same thing, but adds on live code-eval.


@ordoflammae yes, the Language Server Protocol is simply that, a project to standardize the protocol development tools use to communicate with a language server process. So if you were to compare Clojure implementations of LSP then it seems more relevant to compare that protocol with nREPL. You could consider CIDER an LSP implementation, except it does not follow this recent protocol definition. Its no surpise that Microsoft are helping to drive this standard, as it will greatly help VS Code provide more features as the various language communities start implementing plugins and services that use the LSP communication specification. It is really helpful for developers that build tools to have a standard protocol, however, as CIDER already provides more features than LSP (in Clojure and in other languages) so I am not sure how much effort is being put into building a defacto LSP imprlementation for Clojure (there seem to be a few fledgling projects. That said, there is no reason someone could not provide LSP for CIDER, as I believe it can already use different protocols other than nrepl.


Would it be possible/practical to build a LSP implementation for Clojure on top of nREPL? Or have I just misunderstood something?


Looking at it gives the impression that LSP over nrepl is what they are doing (but I havent read through the project in any detail).


Yeah, it does seem like that's what they're doing. I may look into that project if I have any time..