Fork me on GitHub

Apologies if this is already covered, but … I’m seeing different linting rules applied in the VS editor than those applied when I run lein clojure-lsp format. More in 🧵


I’ve got this in config.edn :

:lint-as { clojure.core/let}
When run via lein I’ll end up with e.g.
(prop/for-all [v a-generator]
  (a-fn v))
but in the editor it formats like this:
(prop/for-all [v a-generator]
              (a-fn v)))
even though the editor will format let like this:
(let [v a-generator]
  (a-fn v))


The project uses [com.github.clojure-lsp/lein-clojure-lsp "1.3.10"], which depends on [com.github.clojure-lsp/clojure-lsp-standalone "2022.06.29-19.32.13"] , and Calva says “clojure-lsp version used: 2022.06.29-19.32.13”


it seems your pasted config.edn is from .clj-kondo/config.edn which is not used for formatting, for format clojure-lsp uses cljfmt, which can be configured on .lsp/config.edn


The doc here says

Calva does no linting, yet with Calva you get excellent linting. That is because Calva uses clojure-lsp, which provides linting powered by clj-kondo.
Does that doc need to change?


No, lint is not the same thing of formatting on most docs. Lint means: know your code, unknown vars, unused stuff, diagnostics. Format means: fix whitespaces etc


Maybe we could make that more clear though


OK - I was definitely conflating them.


Thanks for the clarification.

👍 1

For anybody paying attention, I learned from @UKFSJSM38 that Calva has a setting to command it to use clojure-lsp’s config

👍 2
Ramon Rios12:07:59

lein update-in :dependencies conj '[nrepl,"0.9.0"]' -- update-in :dependencies conj '[cider/cider-nrepl,"0.28.5"]' -- update-in :plugins conj '[cider/cider-nrepl,"0.28.5"]' -- update-in '[:repl-options,:nrepl-middleware]' conj '["cider.nrepl/cider-middleware"]' -- with-profile +dev repl :headless
/bin/sh: lein: command not found
Jack-in process exited. Status: 127
Did someone got this when updating to Mac os Monterey?


It is probably that VS Code is not started in an environment where lein is on the path. Start VS Code from the command line in a terminal where lein is found on the path, and jack-in should work.

Ramon Rios12:07:27

I’m able to run repl and connect, but not jack-in

🧵 1