clojure-emacs / cider

The Clojure Interactive Development Environment that Rocks for Emacs
https://cider.mx
GNU General Public License v3.0
3.54k stars 646 forks source link

Unable to specify :cljs-repl-type in cider-connect-clj&cljs #2418

Closed plexus closed 6 years ago

plexus commented 6 years ago

Expected behavior

This is expected to connect a CLJ and CLJS repl, the CLJS repl using `'my-repl-type'

(cider-connect-clj&cljs (list
                         :host "localhost"
                         :port "7888"
                         :project-dir "/my/project"
                         :cljs-repl-type 'my-repl-type))

Actual behavior

This pops up a prompt asking "Select ClojureScript REPL type: ".

The reason this happens is: cider-connect-clj&cljs calls cider-connect-sibling-cljs calls cider--gather-connect-params. This last one ends up overriding the specified value for :cljs-repl-type with cider-cljs-repl-type, which by default is nil.

(plist-put params :cljs-repl-type cider-cljs-repl-type)

Steps to reproduce the problem

Run the above snippet, you can change 'my-repl-type to e.g. 'figwheel. As long as you haven't explicitly set cider-cljs-repl-type, you'll get this prompt.

Environment & Version information

GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2018-07-18
CIDER 0.18.0snapshot (package: 20180816.526)

CIDER version information

Include here the version string displayed when CIDER's REPL is launched. Here's an example:

;; CIDER 0.12.0snapshot (package: 20160331.421), nREPL 0.2.12
;; Clojure 1.8.0, Java 1.8.0_31

Lein/Boot version

E.g. Lein 2.6.1 (skip this when you didn't start the nREPL server using Lein or Boot)

Emacs version

E.g. 24.5 (use M-x emacs-version to check it if unsure)

Operating system

E.g. Fedora 23, OS X 10.11 "El Capitan", Windows 10, etc

bbatsov commented 6 years ago

Ah, great catch! @vspinu made this flexible pretty recently and I guess you're the first person to take advantage of the configurable nature of the command. :-)

bbatsov commented 6 years ago

@vspinu FYI - I plan to cut the new CIDER release in a week or two. Keep this in mind, if you'd like to work on more sesman improvements. Seems the current snapshot is behaving reasonably well for most people, so I guess we can finally promote it to an official release soon.

vspinu commented 6 years ago

Ok. I will fix this and other connection issues by then.

I haven't had time for the REPL<>connection refactoring as the other sesman issues and session browser cut too big of a dent in my time. Unfortunately it will have to wait.