Fork me on GitHub
#calva
<
2021-10-01
>
Hukka08:10:42

Is there an easy way to reindent comments to the same level as code, when the code structure changes?

👆 4
bringe00:10:36

I haven’t found an easy way. It’s something that bugs me sometimes too, but doesn’t happen very often for me. @U0ETXRFEW Do you think it would be challenging to keep comments above shifted forms in line with those forms when the forms change position during formatting? Maybe this is something for cljfmt, though.

pez06:10:36

Yes, it's something for cljfmt, imo. Weavejester use ok with it being added as an option that is default off. https://github.com/weavejester/cljfmt/issues/112

👍 1
Hukka06:10:02

Good to know, and also sensible approach to lean on more general tools. I'm just sometimes (often? always?) confused what parts come from generic clojure tools, what from calva and what is actually VSCode doing it's thing

pez06:10:11

Indeed, I’m sometimes confused about this as well. 😃 It gets extra opaque because there are many ways the different building blocks interact. I tried to shed some light on it in this talk: https://www.youtube.com/watch?v=NIk5hVzA_fY

pez06:10:02

As for formatting… I think you can view it as “It is Calva providing all formatting, and cljfmt does the actual work”. So VS Code is not so much involved, either than invoking Calva’s formatter now and then. For legacy reasons we use an (aging) fork of cljfmt, which I regret ever introducing. We’ll need to fix that soonish.

Hukka07:10:02

Ah, so fixing that cljfmt bug wouldn't actually change it in calva, yet?

pez07:10:12

It’s not a bug. 😃 If you add the functionality in cljfmt I promise to fix the fork within a week.

pez07:10:40

I can notice that ticket is years old and not moving forward… Weavejester is not likely to put in the work, since he thinks the formatter shouldn’t touch comments. Someone who thinks it should be possible to make the formatter align comments needs to do the work.

Hukka07:10:58

Yeah, I'm trying to hacktoberfest-dare some people to implement it 😉

😄 1
Stuart10:10:46

Having a weird issue with calva where the code just... disappears... and I have to close and shift to another tab and back to the current tab to get it to appear again. I think its because I'm evaluating something that results in a LOT of REPL output, e.g. a web request. See video:

Stuart10:10:35

oh god! its picked up the sound from my music I had player. I had no idea. Mute before playing!

Stuart10:10:50

oh wait, i see, its just scrolling all the way to the right I think. There is a tiny scrollbar down the very bottom... hmmm..

pez11:10:55

Whoa! Trippy. (I read your mute disclaimer now, haha.)