Fork me on GitHub

Does Calva supports this style of indentation?


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?


Maybe Cursive can do that too?


> 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.


Yes, but to my experience it always shows up somewhere and leads to troubles.

👍 1

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:

🙏 1

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!

Matthew Spencer15:06:47

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?

Matthew Spencer16:06:12

And does that work with clojure-lsp somehow? That would be great for my emacs coworkers.

Matthew Spencer19:06:04

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 for some more details.

Jason Whitlark18:06:10

Is there any way to get multimethods to show up in the outline sidebar?


I was unaware that this doesn't work. I suggest you ask about it in #lsp , or maybe start with searching the issue tracker there.

Jason Whitlark20:06:21

Ok, thanks.

🙏 1