How to set VSCode for clojure/clojurescript development?


#1

Actuallty I’m using VSCode as my main editor, I use the clojure plugin and clojure warrior, but I have many things I miss from other plugins.

How can I set a linter for clojure that works with Code?
The autocomplete and doc features works well with Clojure but with Clojurescript does not

I would like to know how you guys set a good development environment in this editor.


#2

I think the leading and actively developed tool for VSCode is Calva. The author is also active in the Clojurians channel #calva-dev.


#3

@orestis is right that I try to be an active maintainer of Calva. (Failing a bit on that the latest months, but have started to alot some more time to it the last week again.)

Calva supports both Clojure and ClojureScript as long as nREPL can be used. A bit less so with shadow-cljs, but still somewhat working (I use shadow as part of the tool chain for developing Calva).

With Calva you don’t need much else in terms of setup, but I recommend also installing Calva Paredit. Partly because Parinfer is not working very well on VS Code (due to how VS Code handles on-type formatting).

Calva depends on Joker for linting.

The main pain point with Calva is getting the nREPL dependencies right, because it does not yet inject those for you.

Most of this (hopefully all of it) is covered in the README (and wiki):


#4

This is now bundled with Calva so just install Calva and you’ll get both Calva Paredit and Calva Formatter with it.