This is a somewhat trivial concern, but what are y'all doing to get good indentation with HumbleUI? I'm using Emacs, but I'm interested to hear what folks on VSCode or Intellij do too.
Do you mean something extra on top of just normal clojure indentation?
Technically no, but I noticed a disconnect between the clojure-mode default indentation for functions and the preferred indentation for HumbleUI.
(ui/dynamic ctx [{:keys [leading]} ctx]
(ui/rect (paint/fill 0xFFB2D7FE)
(ui/center (ui/padding 10 leading)
(ui/label text))))
Is the default behavior I'm seeing, but the docs look more like
(ui/dynamic ctx [{:keys [leading]} ctx]
(ui/rect (paint/fill 0xFFB2D7FE)
(ui/center (ui/padding 10 leading)
(ui/label text))))
I can technically fix it with define-clojure-indent but that seems fragile since it's based on symbols and not associated with the var
I can add meta to dynamic if you need it
That’s probably because dynamic is a macro and per bbatsov style macros indent content by first arg
I use different convention when everything is indented 2 spaces from paren
described here https://tonsky.me/blog/clojurefmt/
Do other ui elements have multiple args? It's more the multiple args rather than the macro behavior, I think
That’s why examples are that way
I've read that before 😉
Pretty much all my Clojure is for personal stuff, so I tend to use whatever the Emacs defaults are
Yeah you might be right, it’s first arg by default and some macros make an exception to that
like when etc
I've managed not to have real-world issues with define-clojure-indent in both Rum and Fulcro, so maybe it's a moot point.