Permalink
Browse files

Ensure that nREPL server objects can be pretty-printed, fixes NREPL-51

  • Loading branch information...
cemerick committed Apr 18, 2014
1 parent a0cf4c3 commit eb2f33d0f58e1bad723efe54f54d446f4c95d8bd
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/main/clojure/clojure/tools/nrepl/server.clj
@@ -100,11 +100,18 @@
(defrecord Server [server-socket port open-transports transport greeting handler]
java.io.Closeable
(close [this] (stop-server this))
- ;; TODO here for backward compat with 0.2.x; drop eventually
+ ;; TODO here for backward compat with 0.2.x; drop for 0.3.0; this is what's
+ ;; causing the print-method silliness below
clojure.lang.IDeref
(deref [this] this))
(try
+ (require 'clojure.pprint)
+ (#'clojure.pprint/use-method
+ clojure.pprint/simple-dispatch
+ Server
+ #'clojure.pprint/pprint-simple-default)
+
; IRecord not available in 1.2.0
(eval '(defmethod print-method Server
[s w]

0 comments on commit eb2f33d

Please sign in to comment.