This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-23
Channels
- # announcements (3)
- # aws (1)
- # beginners (44)
- # biff (6)
- # calva (31)
- # cider (26)
- # clerk (12)
- # clj-kondo (9)
- # clojure (17)
- # clojure-dev (18)
- # clojure-europe (13)
- # clojure-norway (45)
- # clojure-uk (4)
- # clojurescript (34)
- # datomic (54)
- # dev-tooling (14)
- # emacs (19)
- # events (7)
- # honeysql (2)
- # hyperfiddle (51)
- # lsp (34)
- # malli (24)
- # matrix (1)
- # missionary (5)
- # off-topic (27)
- # re-frame (6)
- # reagent (18)
- # releases (2)
- # sci (6)
- # shadow-cljs (88)
- # vim (9)
If I'm using the new formatting engine (instead of cljfmt), how can I teach it that I want expecting
to be indented the same way as testing
(and other, similar "with"-style indent words)?
No. I get this:
(testing "foo"
(is (= 1 1)))
(expecting "foo"
(expect 1 1))
(both when typing code and pressing return and also when formatting the code separately)
I see. You need to provide indentation rules for those symbols. See https://calva.io/formatting/#configuration
Since I'm using the "new formatting engine (instead of cljfmt)" -- is it still driven by the cljfmt configuration? That was certainly not clear to me...
It's also not obvious where to put global formatting configuration? The weavejester repo talks about per-project config but this config would need to be in any project that uses Expectations...
(The weavejester repo says I could put .cljfmt.edn
in a parent folder but that doesn't seem to be picked up by Calva?)
You need to tell Calva where you have your cljfmt config file. Calva is using cljfmt as a library. If you keep the config outside the workspace Calva will not hot reload changes. But you can open the folder with where the config lives to tinker with it and have ht reload.
Even with .cljfmt.edn
in the top folder of the workspace, it doesn't seem to work...
OK, so if I put .cljfmt.edn
in .calva
and configure Calva with .calva/.cljfmt.edn
as the path, it should pick it up?
Ah, finally got it working...
Does calva.fmt.configPath
allow for ~
or env vars? Just wondering how to get global configuration on every project on every machine...
I don’t know why it’s so finicky. Happens to me too that it seems to not work and then I get it working…
It would be nice if the cljfmt config could be embedded in settings directly -- or perhaps read from ~/.config/calva/
like the custom REPL stuff...
No, I meant the actual EDN.
I'm going to try via clojure-lsp
since that has a global config...
Yeah, that's probably going to be my best compromise. Then I can add it to my vscode-calva-setup repo and just symlink it into ~/.config
on each machine, like I already have to do for some other things (Calva itself, Joyride).
The actual EDN for the default indent config lives in cljfmt, so can’t really be placed on file.
Yeah, CLOJURE-LSP
at least lets me put the :cljfmt
config in ~/.config/clojure-lsp/config.edn
which means I can treat it like other "global" config in my vscode-calva-setup repo. It's some symlinks but it's a one-off.
Thank you once again for your patience walking me through a config/customization issue!
Any time, @U04V70XH6!
Dear Calva friends: https://github.com/BetterThanTomorrow/calva/releases/tag/v2.0.372 • Fix: https://github.com/BetterThanTomorrow/calva/issues/2229 Thanks for reporting, @alexander.minolta. The fix isn’t as clean as I would want it to be, but at least we don’t break the code now.
