editors

Discussion about all editors used for Clojure/ClojureScript
pedrorgirardi 2018-06-14T04:27:33.000001Z

Hi there! And @pez, I’m a little bit out of context reading this from the thread, let me check the conversation on the channel.

pez 2018-06-14T04:33:07.000164Z

This particular thread is about where the conversation started in the channel: that Calva and Calva Formatter disagrees about some formatting. So, when Calva has helped you get all new lines indented and carefully tried to honor some one-indent-form guidelines, and you format the document, things are reindented differently, and in particular, one-indents are thrown out the window.

pedrorgirardi 2018-06-14T04:36:17.000128Z

Looking at cljfmt documentation, it looks like we could try to tweak a few knobs, like this one for example :cljfmt {:indents ^:replace {#".*" [[:inner 0]]}}

pedrorgirardi 2018-06-14T04:36:41.000040Z

> If you want to override all existing indents, instead of just supplying new indents that are merged with the defaults, you can use the :replace hint:

pedrorgirardi 2018-06-14T04:41:57.000026Z

Changing some cljfmt (that’s the formatting library that Calva uses) knobs might work, but it would even better to actually use cljfmt APIs to format as you type.

pedrorgirardi 2018-06-14T04:42:17.000177Z

But I don’t know if there’s such API, I need to check the code.

pez 2018-06-14T06:48:29.000065Z

I was actually going to try use cljfmt for ontype formatting for this very reason, I am sick of the formatting wars and it does not feel good to be publishing extensions that engage in this war against each other! 😃

pez 2018-06-14T06:49:29.000134Z

So if we can pour the one-indent-forms from Calva into that regexp, that will be very awesome. I might try today!

😁 1