spacemacs

Spacemacs docs: http://develop.spacemacs.org/doc/DOCUMENTATION.html http://develop.spacemacs.org/layers/+lang/clojure/README.html https://practicalli.github.io/spacemacs/
niveauverleih 2020-04-08T10:01:54.159500Z

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 https://github.com/borkdude/clj-kondo/blob/master/doc/editor-integration.md and documentation on the lsp layer config in spacemacs here https://develop.spacemacs.org/layers/+tools/lsp/README.html . I am too much of a newbie to put these pieces together. Has anyone done this before?

practicalli-john 2020-04-08T11:13:30.167800Z

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.

borkdude 2020-04-08T11:14:17.168500Z

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

borkdude 2020-04-08T11:14:40.169Z

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

borkdude 2020-04-08T11:15:19.169600Z

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

borkdude 2020-04-08T11:15:39.170100Z

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

practicalli-john 2020-04-08T11:24:23.178500Z

@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.

borkdude 2020-04-08T11:24:39.178700Z

exactly the same

1👍
borkdude 2020-04-08T11:25:33.179300Z

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

practicalli-john 2020-04-08T11:27:37.180200Z

Perfect, thanks.

OrdoFlammae 2020-04-08T13:13:43.181400Z

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

niveauverleih 2020-04-08T13:25:24.182200Z

@ordoflammae have you watched this https://youtu.be/MB3vVREkI7s ?

practicalli-john 2020-04-08T16:33:32.194Z

@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.

OrdoFlammae 2020-04-08T16:36:01.195300Z

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

practicalli-john 2020-04-08T16:46:39.196600Z

Looking at https://github.com/snoe/clojure-lsp/blob/master/deps.edn it gives the impression that LSP over nrepl is what they are doing (but I havent read through the project in any detail).

OrdoFlammae 2020-04-08T16:50:18.197200Z

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