Fork me on GitHub
Jakub Holý (HolyJak)12:02:31

Hello! Is "Format Selection" supposed to work? When I am inside (|) and invoke Paredit Slurp Forward then the next sexp is included and its indentation is adjusted accordingly. But if I just select a piece of code and run Format Selection, its indentation is not corrected as I would have expected (e.g. after I changed let to when-let and want to align the content with the now moved first line). Thank you!


Format Selection needs a selection to work on. Have you selected anything when running the command? If so, what?


btw, I never use Format Selection. I use Calva Format: Format Current Form, which is default bound to tab.

Jakub Holý (HolyJak)13:02:51

Yes, I have selected the whole (when-let ...) Thx for the tip, will try that! I have also noticed that Calva Format: Indent line works to indent the whole sexp. So it is perhaps just some integration with Format selection that is missing?


If the whole (when-let …) is selected the form should be indented by Format Selection. Sounds like a bug to me…


It is unclear to me what would be re-indented when you change a let to a when-let, though. everything should be aligned the same way, right?


Tried it now (also realizing there might stuff to indent 😄 ). Seems to work. Is this what you do to, but it doesn’t work?

Jakub Holý (HolyJak)14:02:04

Yes. I select all of

(when-let [x
      (count [1
and invoke Format Selection and nothing happens. Calva v2.0.173


Very strange. I can format that using Format Selection. Can you file an issue with VS Code’s Help-&gt;Report Issue? Then it will include some details about your setup, that might shed some light on this. Also see if something is reported in the dev console when you use the command.

Jakub Holý (HolyJak)13:02:40

BTW, thanks a lot, Calva is awesome!

❤️ 3
truestory 9
party-corgi 6
calva 3