Fork me on GitHub
#spacemacs
<
2021-05-11
>
practicalli-john13:05:02

I've started letting LSP do the formatting control in my practicalli/spacemacs.d configuration, rather than Cider. This seems to work quite well, although it seems to be missing automatic vertical alignment of pairs, as in let statements, loop or for arguments or in hash-maps. I've also added updates from the spacemacs.tempate after pulling the latest commits to Spacemacs itself. https://github.com/practicalli/spacemacs.d

👍 2
ericdallo15:05:33

Nice! Yes, there is a issue for that on cljfmt :) c/c @UE21H2HHD

lread15:05:53

Yeah, I’m trying to get some input on what folks would want for vertical alignment formatting from cljfmt. My thinking is something you’d have a preference for (on or off) but something you want to sometimes enable/disable for a specific forms, probably through some inline directive.

ericdallo16:05:12

Yeah, it's a good question

ericdallo16:05:55

maybe some way to specify the forms you want vertical align would work for everyone?

ericdallo16:05:05

with a :all option flag as well?

lread16:05:04

There’s a https://docs.cider.mx/cider/indent_spec.html which, for some reason, has not been widely adopted. Maybe we could add an inline {:style/vertical-align (true|false)}. Which would override some project default which would override a default of false.

practicalli-john17:05:02

Thanks for the reminder, I will go and add some examples and my shopping list of features 🙂

lread17:05:36

Here’s the https://github.com/weavejester/cljfmt/issues/36 if you have anything to add!

practicalli-john18:05:58

@UE21H2HHD I've added some initial thoughts and examples of what I currently do. I'll add more if I think of anything. Happy to do some beta testing if needed. Thank you.

lread18:05:19

Cool, thanks so much @U05254DQM!

emilaasa18:05:03

You're doing the lords work @U05254DQM 🙂

😆 3
practicalli-john18:05:38

Possibly, but the work for which lord I cannot be certain of though 🙂 I certainly appreciate @UE21H2HHD spending time on this issue and @UKFSJSM38 for all the help with making lsp work for me (and a great many others)

thanks 3
lread18:05:34

Thanks John, I started work on cljfmt vertical alignment in Feb of 2019, and then figured I should fix a bug in rewrite-cljs to aid the fix, then… well… rewrite-cljc then rewrite-clj v1 and finally… maybe I’ll actually get back to what sparked my meandering journey: the cljfmt vertical alignment feature!

lread18:05:44

I’ll certainly take you up on your offer of testing when the time comes!

👍 3