This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
I'm trying to debug why on emacs+cider+nrepl+shadow-cljs repl, evaluating an expression whose result contains any tagged literal (anywhere in the output), somehow this prevents the result from being pretty-printed. (For example, {:a 1}
pretty-prints, but {:a #js {}}
does not pretty-print. Does anyone familiar with the shadow-cljs code happen to know if or why the presence of a tagged literal in the repl output could prevent the pretty-printing of the repl result?
I think I found it: https://github.com/thheller/shadow-cljs/blob/a496c6febd36a7e9e6919180796f9ace81ff98e0/src/main/shadow/cljs/devtools/server/nrepl_impl.clj#L186 I'll write up an issue on the github.
FWIW shadow-cljs has :devtools {:repl-pprint true}
which directly pprints in the runtime, instead of going the cider pr-str, read-string, pprint in nrepl middleware route
The cider-nrepl middleware route is worth supporting, given that it has multiple configurable printers https://github.com/clojure-emacs/cider-nrepl/blob/3824d72f9ba1a14f9ce9910500db0885f6b39c23/src/cider/nrepl/pprint.clj#L41-L81 Not sure if those have ever worked with Shadow / if they will start working now.
I've had :repl-pprint true
forever, that setting doesn't seem to avoid the read-string issue fixed by #1174.
And I agree with @U45T93RA6 that it's really nice to be able to specify the pprinting with the emacs config cider-print-fn.
With #1174, that's working with my cljs repl now. (I happen to like puget for dev pretty-printing)
Thanks for confirming that - it's great that things like puget also started working here 🎉
Anyway, I'm very happy with this dev setup! (shadow-cljs, cider, & emacs). I've been evaluating clojurescript code with cider-pprint-eval-last-sexp
all afternoon and it's pretty-printing like a charm 🙂
I would like to do this:
(shadow.cljs.devtools.api/watch
:app
{:closure-defines
{'littlereader.anki/url ""}})
i.e. run watch from clojure rather than the shell and pass a closure-define. What I have above doesn’t seem to do it. Is it possible?