The Wayback Machine - https://web.archive.org/web/20220128075615/https://github.com/clojure-emacs/cider/issues/3140
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

Auto detect multiple nrepl connection options, if they exist #3140

Open
zalky opened this issue Jan 25, 2022 · 1 comment
Open

Auto detect multiple nrepl connection options, if they exist #3140

zalky opened this issue Jan 25, 2022 · 1 comment

Comments

@zalky
Copy link

@zalky zalky commented Jan 25, 2022

Expected behavior

I often need to connect to both a clj nrepl server as well as a shadow-cljs nrepl server for full stack dev. Because the clj nrepl server prints its port to .nrepl-port, and shadow prints its port to .shadow-nrepl/nrepl.port, ideally their respective ports should both be automatically discoverable when I try to connect via cider-connect.

Actual behavior

If a clj nrepl server has already printed its port to .nrepl-port, cider-connect will fail to auto-detect the shadow nrepl server port in .shadow-nrepl/nrepl.port. With only a shadow nrepl server running, the shadow nrepl port is automatically detected.

Steps to reproduce the problem

Make sure you have both a clj nrepl server started as well as a shadow cljs nrepl server started before you try to connect to the shadow-cljs server via cider-connect.

I'm not super familiar with the code-base, but as best I can tell the conditional in nrepl-extract-port in nrepl-client.el will always return a single result and cause .nrepl-port to shadow .shadow-nrepl/nrepl.port. nrepl-extract-port might need to return a list.

Environment & Version information

CIDER version information

;; CIDER 1.1.0 (package: 1.1.0.1) (Plovdiv), nREPL 0.8.3
;; Clojure 1.10.3, Java 1.8.0_302

Emacs version

GNU Emacs 27.2 (build 1, x86_64-apple-darwin18.7.0)

Operating system

OSX 11.6.2

@vemv
Copy link
Member

@vemv vemv commented Jan 28, 2022

Sounds reasonable, would you give it a shot (https://docs.cider.mx/cider/contributing/hacking.html#hacking-on-cider-elisp) and propose/draft a PR that you have verified that works for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment