Fork me on GitHub
#calva
<
2022-07-08
>
dchelimsky10:07:25

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 🧵

dchelimsky10:07:11

I’ve got this in config.edn :

:lint-as {clojure.test.check.properties/for-all 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))

dchelimsky11:07:29

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”

ericdallo12:07:41

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

dchelimsky13:07:11

The doc here https://calva.io/linting/ 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?

ericdallo13:07:02

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

ericdallo13:07:23

Maybe we could make that more clear though

dchelimsky13:07:30

OK - I was definitely conflating them.

dchelimsky13:07:36

Thanks for the clarification.

👍 1
dchelimsky14:07:41

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?

pez09:07:55

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