calva 2025-10-31

Despite resolving a macro as fn (clj-kondo), I get this kind of indentation:

(the-foo-macro [x y]
               (rest-of :the-body ...))
instead of (expected):
(the-foo-macro [x y]
  (rest-of :the-body ...))
What am I missing?

You’ll need to also configure cljfmt.

@pez Can you share or point me to any example? I am not using cljfmt in the project and don't have any config file related to cljfmt.

Calva uses cljfmt as its formatter. See: https://calva.io/formatting/

@pez Thanks! I will follow through the details to get this fixed.

I think the TL;DR is something like: • Create a cljfmt.edn file in the project root, with content like:

{:remove-surrounding-whitespace? true
 :remove-trailing-whitespace? true
 :remove-consecutive-blank-lines? false
 :insert-missing-whitespace? true
 :indent-line-comments? true
 :remove-multiple-non-indenting-spaces? false}
• Add an extra-indents rule :extra-indents {the-foo-macro [[:inner 0]]} Calva will hot-reload this file so you can quickly iterate. What I do is that I add a :test entry with a vector of testing code forms in the config file.

Wow, that worked! Thanks @pez

🙏 1

Coming back to this issue. When I interrupt a long evaluation in Calva, there not interaction with repl possible after that (after the Evaluation was interrupted message is printed). I have to restart the whole project and evaluate it. Is there any more vision atm on addressing this?

I think there’s an issue somewhere for having calva set the flag automatically in its default jack-in sequences

What versions of things are you using? Java. Clojure, nrepl, cider-nrepl…

If you're using a recent JDK (21+), you need the "attach self" property set for this to work properly: https://github.com/seancorfield/dot-clojure/blob/develop/deps.edn#L72-L74

I’ve run into this too. Java 21

I am on a babashla project, and there's no deps.end per se

Ah, then this is something with the babashka nrepl server. Does it support interrupting the eval, @borkdude?

unfortunately graalvm doesn't let you do this

So then this is probably Calva not checking correctly if the interrupt op is supported.

java 25 2025-09-16 LTS Calva 2.0.539 Clojure CLI version 1.12.3.1577 @pez

nREPL dependency versions:
    nrepl: effective 1.5.1 (Calva defaults fallback)
    cider-nrepl: effective 0.58.0 (Calva defaults fallback)
    cider/piggieback: effective 0.6.1 (Calva defaults fallback)
  clojure-lsp version configured: latest

@dennisa can you repro the problem with these versions? And do you have allowAttachSelf enabled?