lsp

Shantanu Kumar 2025-11-26T07:18:36.365629Z

Hi. Currently, in Calva "Resolve macro as..." has options: def, defn, let, fn, for etc. Is it possible to add support for do? It impacts the indentation in Calva. (Please let me know if I should post this in #calva.)

pez 2025-11-26T08:00:48.305089Z

Macro-resolution shouldn’t impact Calva’s indentation. What’s your setting for calva.fmt.configPath?

Shantanu Kumar 2025-11-26T08:04:59.395609Z

I have not set calva.fmt.configPath anywhere. Macro invocation by default results in indentation similar to fn calls:

(the-macro
 arg1
 arg2)

(the-fn
 arg1
 arg2)
For a certain macro (which is a do style macro) I want it to be 2-space.

pez 2025-11-26T08:15:28.805169Z

You configure this via :extra-indents in cljfmt config. https://calva.io/formatting/#configuration This can be a bit tricky, because the indents spec is not immediately intuitive for everyone (certainly wasn’t for me). Since you haven’t configured calva.fmt.configPath, you can create a cljfmt.edn file in your project root and Calva should pick it up. The Resolve macro as... command is for the linter. You may need to configure both.

Shantanu Kumar 2025-11-26T08:21:59.784429Z

Thank you! No success with the-macro [[:inner 2]] (under :extra-indents) yet, but I will tweak and find out.

Shantanu Kumar 2025-11-26T08:22:48.066799Z

Turns out, the-macro [[:inner 0]] works for my case.

🎉 2