-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Pretty Printing more Configurable #436
Conversation
User can client or server side. pprint on/off moved to this new setting
Right, so now I have implemented this so that #415 is taken care of in what I think is a user friendly way. Please have a look at the changes and also put them to some testing, because I had to change stuff in quite a lot of places in order to get the pprint configuration in place. I might have broken something, but nothing that I find in my testing at least. To understand the changes I think it is best to start with the added pprint documentation. |
…anTomorrow/calva into wip/configurable-pprint
Why do we not simplify the configuration a bit like this and have only one setting for the print engine where calva is client and all other choices are the server ones. I find this a bit easier to understand:
|
Yeah, that's much better. I'll fix! |
There. Great that you saw how the confusion could get removed! |
What has Changed?
The pretty printing through
nrepl
does more than just pretty printing the results, it expands reader literals and values. At least for all built-in printers, exceptclojure.core/pprint
. This seems non-trivial to fix so this PR tries to give the users options to ”pick her poison”. I plan to offer a settings something like so:clojure.core/pprint
, this leaves reader literals and values alone, but the pretty printing is limitedfipp
, expands reader literals and chokes on e.g. Datomic:db
values, but the a decent pretty printerpuget
, expands reader literals and values, popular pretty printing enginezprint
, same effect on the data aspuget
, advanced and configurable pretty printing.zprint
, leaves the data alone, chokes on e.g. Datomic:db
values when parsing to EDN (and prints plain if so). Pretty printing is great when the data parses to EDN.With
zprint
there is hope for much improvement, because @kkinnear is looking at it. See this issue: kkinnear/zprint#111Depending on wether, and how, this is fixed in
zprint
this PR might not be needed. Or rather change to just using zprint as the pprint engine, w/o the user getting to choose it.Fixes #415 #378
My Calva PR Checklist
I have:
dev
branch. (Or have specific reasons to target some other branch.)master
. (Sorry for the nagging.)ci/circleci: build
test. (For now you'll need to opt in to the CircleCI New Experience UI to see the Artifacts tab, because bug.)[Unreleased]
entry inCHANGELOG.md
, linking the issue(s) that the PR is addressing.The Calva Team PR Checklist:
Before merging we (at least one of us) have:
dev
branch (unless reasons).Ping @PEZ, @kstehn, @cfehse