This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-03
Channels
- # announcements (6)
- # babashka (14)
- # beginners (17)
- # biff (3)
- # calva (19)
- # circleci (3)
- # clj-on-windows (1)
- # cljdoc (21)
- # cljs-dev (6)
- # clojure (119)
- # clojure-australia (2)
- # clojure-europe (28)
- # clojure-france (3)
- # clojure-norway (12)
- # clojure-survey (2)
- # clojure-uk (7)
- # clojurescript (25)
- # core-typed (1)
- # cursive (11)
- # datomic (53)
- # emacs (14)
- # events (1)
- # gratitude (1)
- # holy-lambda (21)
- # integrant (2)
- # jobs (1)
- # jobs-discuss (3)
- # juxt (3)
- # kaocha (1)
- # lsp (17)
- # nbb (14)
- # off-topic (25)
- # pathom (11)
- # re-frame (24)
- # releases (1)
- # remote-jobs (2)
- # rewrite-clj (10)
- # shadow-cljs (11)
- # sql (3)
- # tools-build (6)
- # tools-deps (83)
- # vim (26)
- # xtdb (10)
Yes and No. Calva has a command for it: Format and align current form. And you can configure the formatter to use it. But it is not maintained (only there for legacy reasons). It has known issues. Also, as maintainers of Calva we do not endorse this style of formatting. It leads to massive whitespace noice in the source control.
My file is formatted in this way because I opened cursive to edit it today (for java interop). Given the above, now my question becomes how do I format it back to the normal calva style?
> It leads to massive whitespace noice in the source control
I've heard this argument a lot but I don't really buy it to be honest 😛, git diff has had the ignore-space-change
flag for a while
> Ignore changes in amount of whitespace. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent.
https://git-scm.com/docs/diff-options#Documentation/diff-options.txt-ignore-space-change
Anyway, I shouldn't have mentioned that aspect of it probably. It derails from the real issue, that using this feature in Calva is a sure road to pain.
I personally use this style extensively ever since I started using Calva, and it was only in this thread that I learned that it's not actually supported. I still like it since IMO it increases code clarity (especially in deps.edn files and large maps), but ultimately it's personal preference.
If it works for you, @U02FU7RMG8M, that's cool. See here for some bit more info than I have provided in this thread: https://calva.io/formatting/#about-aligning-associative-forms
Just to clarify, it's the "automatic" aligner provided via the old cljfmt that's not supported, while the manual "Format and align current form" command (which is what I actually use) is still supported as part of Calva, right?
It’s the same mechanism being used in both cases, so the same limitations apply. But it is much safer to use it on demand.
> Also, as maintainers of Calva we do not endorse this style of formatting Thank you so much ❤️. When I read this kind of alignment I never know when a line ends and the other starts and end up reading things cross-lined!
Hi all. Is there a way to read cljfmt options from project.clj so they are the same as running the lean cljfmt plugin which uses settings from there?
And does that work with clojure-lsp somehow? That would be great for my emacs coworkers.
It looks like I can at least do it with clojure-lsp in .cljfmt.edn. Thats a good start.
Calva does not read the cljfmt options from project.clj. What you can do is to create a separate .edn
file with the configuration and then set the calva.fmt.configPath
to point to the file. See https://calva.io/formatting/#configuration for some more details.
Is there any way to get multimethods to show up in the outline sidebar?