Fork me on GitHub
#calva
<
2022-06-03
>
pinkfrog09:06:24

Does Calva supports this style of indentation?

pez09:06:52

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.

pinkfrog09:06:01

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?

pez10:06:30

Maybe Cursive can do that too?

pavlosmelissinos10:06:07

> 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

pez10:06:26

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

👍 1
pez10:06:08

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.

Kelvin16:06:40

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.

pez16:06:13

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

🙏 1
Kelvin16:06:13

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?

pez18:06:35

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.

mauricio.szabo00:06:30

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

pez20:06:18

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.

Jason Whitlark18:06:10

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

pez20:06:34

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