This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-12
Channels
- # babashka (37)
- # beginners (27)
- # biff (1)
- # calva (18)
- # cider (45)
- # clj-on-windows (5)
- # cljsrn (1)
- # clojure (90)
- # clojure-art (3)
- # clojure-uk (1)
- # clojurescript (7)
- # core-logic (4)
- # datomic (4)
- # events (2)
- # fulcro (3)
- # hyperfiddle (23)
- # leiningen (66)
- # malli (1)
- # meander (7)
- # nrepl (1)
- # off-topic (9)
- # pathom (1)
- # re-frame (15)
- # reitit (19)
- # remote-jobs (1)
- # shadow-cljs (103)
Calva has a command Format and Align Current Form that does this. You have to place the cursor outside the binding vector for it to work.
I was imagining that the entire file would format no matter where the cursor was (unless a particular piece was highlighted). Just a different set of expectations is all
Just checking. The command Format and Align Current Form made you expect the whole file to be formatted?
Haha. 😃 I wasn't trying to make a point. I want to understand your expectations. I think there might be an improvement opportunity for Calva here.
it’s no problem at all! I didn’t read the full description so that is definitely on me!
Is there a capability or one in the future to define the form as a variable? For example if I have this form selected (do-something 1)
I’d like to be able to define this in a let
block surrounding the form
Ah, that’s headed in the right direction yes! I could use that some now that I know it is there. Thank you
The other piece I was thinking about was to be able to add to an existing let
block if one already wraps the form. A bit trickier I imagine
If you search the command palette for “Calva Refactor” you can see the other available refactoring commands.
Interesting, I didn’t know calva had its own refactors 😅 We should add them to the refactors that pop up when you hit the refactor key
ctrl+shift+r is the default. I know about all the lsp refactors, since they get show when hitting that key, but introduce let doesn’t. It’s probably a problem with lsp’s CodeAction provider