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.)
Macro-resolution shouldn’t impact Calva’s indentation. What’s your setting for calva.fmt.configPath?
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.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.
Thank you! No success with the-macro [[:inner 2]] (under :extra-indents) yet, but I will tweak and find out.
Turns out, the-macro [[:inner 0]] works for my case.