Skip to content

Commit 148bc01

Browse files
author
Bruce Hauman
committed
honor :repl-requires
I’m not entirely certain why this code is needed to respect :repl-requires as the option is getting forwarded to the cljs.repl/repl call. Alas it is needed and this works.
1 parent 52bd059 commit 148bc01

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/cider/piggieback.clj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,12 @@
163163
(set! ana/*cljs-ns* 'cljs.user)
164164
;; this will implicitly set! *cljs-compiler-env*
165165
(run-cljs-repl (assoc ieval/*msg* ::first-cljs-repl true)
166-
;; TODO: This needs to be looked at
167-
(nrepl/code (ns cljs.user
168-
(:require [cljs.repl :refer-macros (source doc find-doc
169-
apropos dir pst)])))
166+
;; this is needed to respect :repl-requires
167+
(if-let [requires (not-empty (:repl-requires opts))]
168+
(pr-str (cons 'ns `(cljs.user (:require ~@requires))))
169+
(nrepl/code (ns cljs.user
170+
(:require [cljs.repl :refer-macros [source doc find-doc
171+
apropos dir pst]]))))
170172
repl-env nil options)
171173
;; (clojure.pprint/pprint (:options @*cljs-compiler-env*))
172174
(set! *cljs-repl-env* repl-env)

0 commit comments

Comments
 (0)