Fork me on GitHub
#calva
<
2022-09-15
>
pez06:09:45

Dear Calva-friends. Ever wanted to re-format an entire form or file, including breaking lines up and such? In this build there is a new command that does this, Calva: Replace Current Form (or Selection) with Pretty Printed Form: • https://output.circle-artifacts.com/output/job/5c8fee54-c6d9-4361-aa75-72c7f171b31e/artifacts/0/tmp/artifacts/calva-2.0.301-1843-pretty-print-code-3b7b6567.vsix Please help in testing it. There are some internal changes to the client side pretty printing engine (named calva) that shoudln't be affected, but if you are using this option for pretty printing, please consider helping to test the VSIX. Thanks in advance! 🙏 ❤️ calva

❤️ 2
pez06:09:52

For #joyride users. This build also has some new API. • There's an calva/editor.replace. function that will replace a range in a document with the new text you provide. See https://github.com/BetterThanTomorrow/calva/blob/1843-pretty-print-code/docs/site/api.md#editor. • A calva/pprint.prettyPrint function will take a string with Clojure code/data and return a string with a prettier version of the same code. See https://github.com/BetterThanTomorrow/calva/blob/1843-pretty-print-code/docs/site/api.md#pprint.

orestis15:09:49

Nice! Is this affected by REPL limits eg Max 100 items in collection?

orestis15:09:32

I can't remember the exact term, is that **print-length*?*

pez19:09:10

Currently it follows whatever Calva pretty print settings you have in VS Code. It is completely static. The REPL is not used.