Fork me on GitHub

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

👆 4

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.


Yes, it's something for cljfmt, imo. Weavejester use ok with it being added as an option that is default off.

👍 1

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


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:


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.


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


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


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.


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

😄 1

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:


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


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..


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