Skip to content

Commit c9ca4cb

Browse files
hagmonkbbatsov
authored andcommitted
[Fix #537] Revert breaking change to the signature of cider.nrepl/init (#538)
- revert `cider-nrepl.main/init` such that it takes a vector of middlewares - have `cider-nrepl.main/init` pass a map of arguments to `start-nrepl` - tweak cider nrepl boot task to pass a map to `start-nrepl` directly - set defaults for `port` and `bind` to keep `nrepl-server` happy
1 parent c74d247 commit c9ca4cb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/cider/tasks.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
(util/dbug* "nREPL middleware: %s\n" (vec default-mws))
3131
(boot.core/with-pass-thru [_]
3232
(require 'cider-nrepl.main)
33-
((resolve 'cider-nrepl.main/init) {:middleware default-mws
34-
:port port
35-
:bind bind}))))
33+
((resolve 'cider-nrepl.main/start-nrepl) {:middleware default-mws
34+
:port port
35+
:bind bind}))))

src/cider_nrepl/main.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
(defn start-nrepl
3232
[opts]
33-
(let [{:keys [handler middleware bind port]} opts
33+
(let [{:keys [handler middleware bind port] :or {port 0 bind "::"}} opts
3434

3535
handler (cond-> (or handler nrepl.server/default-handler)
3636
middleware (apply (->mw-list middleware)))
@@ -51,7 +51,7 @@
5151
(defn init
5252
([]
5353
(init nil))
54-
([opts]
55-
(start-nrepl opts)
54+
([handlers]
55+
(start-nrepl {:handler handlers})
5656
;; Return nil so the value doesn't print
5757
nil))

0 commit comments

Comments
 (0)