-
-
Notifications
You must be signed in to change notification settings - Fork 653
Description
Expected behavior
cider-toggle-buffer-connection
should toggle between CLJ and CLJS connections (if both exist) in a clojurec-mode
buffer (e.g. cljc
files) or in a cider-clojure-interaction-mode
buffer (e.g. *cider-scratch*
). This should allow expressions to be evaluated in the appropriate connection. Also, cider-connections
should still contain both CLJ and CLJS connections after toggling.
Actual behavior
Connection to REPL is seemingly lost; evaluating expressions causes CIDER to complain that a Clojure REPL is required and that a jack in is probably needed. Also, cider-connections
loses one of the connections (the current one).
Steps to reproduce the problem
- Do
lein new cider-toggle-buffer-connection
- Edit
project.clj
to the following:
(defproject cider-toggle-buffer-connection "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[com.cemerick/piggieback "0.2.1"]
[org.clojure/clojure "1.7.0"]]
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
)
- Do
mv src/cider-toggle-buffer-connection/core.cljs src/cider-toggle-buffer-connection/core.cljc
- Edit
src/cider-toggle-buffer-connection/core.cljc
to the following:
(ns cider-toggle-buffer-connection.core)
(println "Test")
- Open
src/cider-toggle-buffer-connection/core.cljc
in emacs. - Do
cider-jack-in-clojurescript
. - Take note of the value of
cider-connections
: there should be two connections (CLJ and CLJS). - Evaluate
(println "Test")
withcider-eval-last-sexp
. This should print "Test" in the*cider-repl cider-toggle-buffer-connection*
buffer. - Do
cider-toggle-buffer-connection
. - Evaluate
(println "Test")
withcider-eval-last-sexp
. This should cause CIDER to complain with the following message:
user-error: ‘cider-eval-last-sexp’ needs a Clojure REPL.
If you don’t know what that means, you probably need to jack-in (‘C-c M-j’).
- Take note of the value of
cider-connections
: only the CLJS connections remains.
Environment & Version information
CIDER version information
;; CIDER 0.14.0 (Berlin), nREPL 0.2.12
;; Clojure 1.8.0, Java 1.8.0_74
Emacs version
GNU Emacs 25.1.3 (x86_64-apple-darwin15.6.0, Carbon Version 157 AppKit 1404.47) of 2016-09-18
Operating system
OSX 10.11.6