2
2
3
3
== Configuring a printing function
4
4
5
- NOTE: Pretty-printing was overhauled in CIDER 0.21 to leverage new features introduced in nREPL 0.6.
6
- Refer to https://nrepl.org/nrepl/usage/misc.html#_pretty_printing[nREPL's documentation] for details.
5
+ NOTE: CIDER relies on nREPL's own value printing mechanism. Refer to
6
+ https://nrepl.org/nrepl/usage/misc.html#pretty_printing[nREPL's documentation]
7
+ for details.
7
8
8
9
You can configure the function used by CIDER for pretty-printing evaluation
9
10
results and other data using the option `cider-print-fn`, which can take the
@@ -15,14 +16,16 @@ equivalent of `clojure.core/pr`.
15
16
* `pr` to use the equivalent of `clojure.core/pr`.
16
17
* `pprint` to use the built-in `clojure.pprint/pprint` (this is the default).
17
18
* `fipp` to use the https://github.com/brandonbloom/fipp[Fast Idiomatic
18
- Pretty-Printer]. This is approximately
19
- 5-10x faster than `clojure.core/pprint`.
19
+ Pretty-Printer]. This is approximately 5-10x faster than `clojure.core/pprint`.
20
20
* `puget` to use https://github.com/greglook/puget[Puget], which provides
21
21
https://github.com/greglook/puget#canonical-representation[canonical serialization]
22
22
of data on top of fipp, but at a slight performance cost.
23
23
* `zprint` to use https://github.com/kkinnear/zprint[zprint], a fast and
24
24
flexible alternative to the libraries mentioned above.
25
25
26
+ For `fipp`, `puget`, and `zprint` printers to work, you need to add a
27
+ respective dependency into your project explicitly.
28
+
26
29
Alternatively, `cider-print-fn` can be set to the namespace-qualified name of a
27
30
Clojure var whose function takes three arguments: the object to print, the
28
31
`java.io.PrintWriter` to print on, and a (possibly nil) map of options.
@@ -49,11 +52,6 @@ Here's one example:
49
52
(apply pp/write value (mapcat identity (assoc options :stream writer))))
50
53
----
51
54
52
- IMPORTANT: Before Clojure 1.10.2, a
53
- https://clojure.atlassian.net/browse/CLJ-1445[bug] in `clojure.pprint` caused it
54
- to not work properly with `+*print-meta*+`. If you need to print the metadata
55
- you'll have to change the print function or disable pretty-printing.
56
-
57
55
== Limiting printed output
58
56
59
57
You can set `cider-print-quota` to limit the number of bytes that will be
0 commit comments