Skip to content

Commit

Permalink
Ensure that nREPL server objects can be pretty-printed, fixes NREPL-51
Browse files Browse the repository at this point in the history
  • Loading branch information
cemerick committed Apr 18, 2014
1 parent a0cf4c3 commit eb2f33d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/clojure/clojure/tools/nrepl/server.clj
Expand Up @@ -100,11 +100,18 @@
(defrecord Server [server-socket port open-transports transport greeting handler] (defrecord Server [server-socket port open-transports transport greeting handler]
java.io.Closeable java.io.Closeable
(close [this] (stop-server this)) (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 clojure.lang.IDeref
(deref [this] this)) (deref [this] this))


(try (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 ; IRecord not available in 1.2.0
(eval '(defmethod print-method Server (eval '(defmethod print-method Server
[s w] [s w]
Expand Down

0 comments on commit eb2f33d

Please sign in to comment.