calva

Wednesdays you might find @U0ETXRFEW in the Gather Calva space. Invite is https://gather.town/invite?token=GZqrm7CR and the password is `Be kind`.
Jakub Holý 2021-02-23T12:33:31.044700Z

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!

pez 2021-02-23T12:44:59.046200Z

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

pez 2021-02-23T12:47:55.047400Z

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

Jakub Holý 2021-02-23T13:01:51.048500Z

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?

Jakub Holý 2021-02-23T13:02:40.048800Z

BTW, thanks a lot, Calva is awesome!

1
❤️ 1
2
3
pez 2021-02-23T13:31:13.049Z

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

pez 2021-02-23T13:35:06.049200Z

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?

pez 2021-02-23T13:40:47.049400Z

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ý 2021-02-23T14:25:04.049900Z

Yes. I select all of

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

pez 2021-02-23T15:43:35.050300Z

Very strange. I can format that using Format Selection. Can you file an issue with VS Code’s Help->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.