diff options
author | Bozhidar Batsov <bozhidar@batsov.com> | 2018-01-15 09:58:07 +0200 |
---|---|---|
committer | Bozhidar Batsov <bozhidar@batsov.com> | 2018-01-15 09:58:07 +0200 |
commit | b31b5e309cb3b4569dc237b44b0b6b8e73fc33a3 (patch) | |
tree | 040226dae9b7146ffe726a43c57e8f07ce7dd201 /cider.el | |
parent | 7cb5d39aee33606241c4b0a664e2a0fc98f8ba86 (diff) |
[Fix #1976] Add an interactive command for connecting to a running ClojureScript
REPL
This worked in the past as well, but someone had to toggle the type of the REPL
to "cljs" using `cider-repl-type` which was not obvious to most people. I also
added an interactive command for toggling the REPL type - `cider-repl-set-type`.
This fixes a mess I had created before - I had copy-pasted some code I planned
to tweak from the related issue and I committed this code upstream by mistake.
Diffstat (limited to 'cider.el')
-rw-r--r-- | cider.el | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -671,19 +671,18 @@ gets associated with it." ;; associate if we're in a project, prompt otherwise ((eq cider-prompt-for-project-on-connect 'when-needed) (cider-assoc-project-with-connection project-dir conn)) ;; always prompt - (t (cider-assoc-project-with-connection nil conn)))))))) - -(defun cider-repl-set-type (&optional type) - "Set REPL TYPE to \"clj\" or \"cljs\"." - (interactive) - (let ((type (or type (completing-read "Set REPL type to: " '("clj" "cljs"))))) - (setq cider-repl-type type))) + (t (cider-assoc-project-with-connection nil conn))))) + conn))) (defun cider-connect-clojurescript () - "Connect to a clojurescript repl." + "Connect to a ClojureScript REPL. + +It just delegates pretty much everything to `cider-connect' and just sets +the appropriate REPL type in the end." (interactive) - (cider-connect) - (cider-repl-set-type "cljs")) + (when-let* ((conn (call-interactively #'cider-connect))) + (with-current-buffer conn + (setq cider-repl-type "cljs")))) (defun cider-current-host () "Retrieve the current host." |