Fork me on GitHub
#calva
<
2021-02-23
>
holyjak12: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!

pez12:02:59

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

pez12:02:55

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

holyjak13: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?

pez13:02:13

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

pez13:02:06

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?

pez13:02:47

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

holyjak14:02:04

Yes. I select all of

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

pez15:02:35

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.

holyjak13:02:40

BTW, thanks a lot, Calva is awesome!

❤️ 1
truestory 3
party-corgi 2
calva 1