This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-11
Channels
- # announcements (6)
- # architecture (14)
- # babashka (26)
- # beginners (22)
- # calva (11)
- # clj-kondo (2)
- # clj-on-windows (1)
- # cljsrn (10)
- # clojure (116)
- # clojure-europe (5)
- # clojure-uk (1)
- # clojurescript (5)
- # cursive (9)
- # datomic (21)
- # depstar (1)
- # events (1)
- # fulcro (2)
- # graalvm (17)
- # graalvm-mobile (28)
- # helix (3)
- # introduce-yourself (2)
- # jobs (2)
- # lsp (4)
- # meander (1)
- # off-topic (4)
- # pathom (5)
- # polylith (6)
- # practicalli (5)
- # reagent (67)
- # reitit (1)
- # releases (2)
- # shadow-cljs (24)
- # tools-deps (23)
Hello! I’m using Cursive for Fulcro, and I’m getting unexpected indentation behavior… when first argument is on a separate line, it’s fine. But when it’s on the same line, indentation is far more than expected. Any thoughts? (I was pairing with @tony.kay, and he was surprised as well — I’m assuming that this means he didn’t see this behavior on his system.). Thanks in advance!
You can "teach" cursive how to indent stuff. With the cursor on top of dom/div
, open the "intention actions" context menu (Alt-Enter on linux, not sure on other OSs), select "Configure indentation for dom/div...", and pick "Indent".
Cursive should then remember how to indent that symbol, it's stored in the CodeStyle, I think. That said, sometimes I have to do that again after a while.
@U6VPZS1EK That’s the proper indentation. The rule is: All parameters to a function are aligned vertically. Since you put the first parameter on a new line, it gets the normal 2 space indentation, and all other parameters are alighted vertically beneath it.
in the Cursive settings Editor -> Code Style -> Clojure -> General you can set "Default To Only Indent". that IMHO is a better default and does what you wanted as a default, which you can still override for the exceptions if you want any.
Oh, that’s lovely, @U05224H0W! Thank you! (And loving all you’re doing with shadow-cljs, too! 🙂