Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a better error when a cljs repl form cannot be found #2307

Merged
merged 1 commit into from
Jun 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bugs fixed

* [#2286](https://github.com/clojure-emacs/cider/issues/2286): Fix eldoc issue with images in the REPL.
* [#2307](https://github.com/clojure-emacs/cider/pull/2307): Use a better error when a cljs repl form cannot be found.

## 0.17.0 (2018-05-07)

Expand Down
17 changes: 9 additions & 8 deletions cider.el
Original file line number Diff line number Diff line change
Expand Up @@ -755,14 +755,15 @@ you're working on."

(defun cider-cljs-repl-form (repl-type)
"Get the cljs REPL form for REPL-TYPE."
(let ((repl-form (cadr (seq-find
(lambda (entry)
(eq (car entry) repl-type))
cider-cljs-repl-types))))
;; repl-form can be either a string or a function producing a string
(if (symbolp repl-form)
(funcall repl-form)
repl-form)))
(if-let* ((repl-form (cadr (seq-find
(lambda (entry)
(eq (car entry) repl-type))
cider-cljs-repl-types))))
;; repl-form can be either a string or a function producing a string
(if (symbolp repl-form)
(funcall repl-form)
repl-form)
(user-error "No ClojureScript REPL type %s found. Please make sure that `cider-cljs-repl-types' has an entry for it" repl-type)))

(defun cider-verify-cljs-repl-requirements (repl-type)
"Verify that the requirements for REPL-TYPE are met."
Expand Down