Skip to content

Commit 7e4b5e9

Browse files
authored
Add Krell REPL support (#2861)
This change adds the support for Krell REPL. Instead of having to pick a custom REPL and specifying a cider-custom-cljs-repl-init-form, this is all now included. All the user has to do is pick the REPL type, which in this case is krell.
1 parent 4b55995 commit 7e4b5e9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

cider.el

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,12 @@ Generally you should not disable this unless you run into some faulty check."
689689
(unless (cider-library-present-p "adzerk.boot-cljs-repl")
690690
(user-error "The Boot ClojureScript REPL is not available. Please check https://github.com/adzerk-oss/boot-cljs-repl/blob/master/README.md for details")))
691691

692+
(defun cider-check-krell-requirements ()
693+
"Check whether we can start a Krell ClojureScript REPL."
694+
(cider-verify-piggieback-is-present)
695+
(unless (cider-library-present-p "krell.repl")
696+
(user-error "The Krell ClojureScript REPL is not available. Please check https://github.com/vouch-opensource/krell for details")))
697+
692698
(defun cider-check-shadow-cljs-requirements ()
693699
"Check whether we can start a shadow-cljs REPL."
694700
(unless (cider-library-present-p "shadow.cljs.devtools.api")
@@ -825,6 +831,15 @@ The supplied string will be wrapped in a do form if needed."
825831
cider-check-boot-requirements)
826832
(shadow cider-shadow-cljs-init-form cider-check-shadow-cljs-requirements)
827833
(shadow-select cider-shadow-select-cljs-init-form cider-check-shadow-cljs-requirements)
834+
(krell "(require '[clojure.edn :as edn]
835+
'[clojure.java.io :as io]
836+
'[cider.piggieback]
837+
'[krell.api :as krell]
838+
'[krell.repl])
839+
(def config (edn/read-string (slurp (io/file \"build.edn\"))))
840+
(krell/build config)
841+
(apply cider.piggieback/cljs-repl (krell.repl/repl-env) (mapcat identity config))"
842+
cider-check-krell-requirements)
828843
(custom cider-custom-cljs-repl-init-form nil))
829844
"A list of supported ClojureScript REPLs.
830845
@@ -867,6 +882,7 @@ you're working on."
867882
(const :tag "Boot" boot)
868883
(const :tag "Shadow" shadow)
869884
(const :tag "Shadow w/o Server" shadow-select)
885+
(const :tag "Krell" krell)
870886
(const :tag "Custom" custom))
871887
:group 'cider
872888
:safe #'symbolp

0 commit comments

Comments
 (0)