Skip to content
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

pretty printing has moved from cider into nrepl #329

Closed
SevereOverfl0w opened this issue Jan 15, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@SevereOverfl0w
Copy link
Contributor

commented Jan 15, 2019

This means that the current pretty printing only works with cider<20. For cider>=20 we will need to rely on the middleware that's now in nrepl.

The upside is that the version in nrepl is less special, it outputs to :value for example. It also supports zprint, which is an excellent code formatter.

@bbatsov

This comment has been minimized.

Copy link

commented May 1, 2019

The relevant documentation is here https://nrepl.org/nrepl/0.6.0/design/middleware.html#_pretty_printing

In nREPL you can also elect to get the value streamed (split in several chunks), so that interrupt an evaluation that results in some huge output (and get the initial feedback much faster).

@SevereOverfl0w

This comment has been minimized.

Copy link
Contributor Author

commented May 1, 2019

we could potentially take advantage of that (I do some similar things in replant) but it would require some reworking to how fireplace is set up.

The annoyance (for me) is that fireplace can't set the default to something like fipp, and has to use clojure.pprint/pprint as the default because that's the only thing that's always available. fipp is significantly superior in speed though.

@bbatsov

This comment has been minimized.

Copy link

commented May 1, 2019

Well, I guess it can check if cider-nrepl is around and fallback to clojure.pprint. I assume most fireplace users use it with cider-nrepl, so that shouldn't be a big deal.

@SevereOverfl0w

This comment has been minimized.

Copy link
Contributor Author

commented May 1, 2019

I'm often surprised how many people use fireplace without cider-nrepl! Maybe as part of the init on the connection we can attempt to detect cider.

If we could sideload we could bring our own pretty printers which would make this redundant.

@bbatsov

This comment has been minimized.

Copy link

commented May 1, 2019

Indeed. That's why I view nrepl/nrepl#109 as the most important improvement left for nREPL.

With it in place you'll also be able to just inject Orchard and few other regular libs and be able to do a lot of things just by evaluating stuff, although this would also require clients to parse EDN, which I hear is a solved problem in vim.

@tpope tpope closed this in cb124b8 May 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.