Skip to content

Loading…

CIDER does not load the cider-nrepl middleware when connecting to an embedded nREPL server. #640

Closed
pbostrom opened this Issue · 11 comments

4 participants

@pbostrom

Basic CIDER functionality seems to work with embedded nREPL server, but it cannot find the cider-nrepl middleware. I created a minimal repo to reproduce the problem.
https://github.com/pbostrom/embed-nrepl

Version info:
CIDER 0.7.0alpha (package: 20140618.557) (Java 1.7.0_55, Clojure 1.6.0, nREPL 0.2.3, cider-nrepl 0.7.0-snapshot)

@gtrak
@gtrak
@bbatsov
clojure-emacs member
@bbatsov
clojure-emacs member

Regarding the question in hand - @gtrak is right. You have to pass a custom handler to start-server. I'm not sure if the approach taken in lein is the best, but I'm sure @cemerick is the authority on the matter; perhaps he'd suggest a simple way add to providea handler composed of all our middleware.

@pbostrom

I suppose this is one way to do it:
https://github.com/pbostrom/embed-nrepl/blob/master/src/embed_nrepl/core.clj
This works but would be hard to maintain. It would be nice to have a convenience function in the plugin that returns a vector of all the cider middleware vars.

@bbatsov
clojure-emacs member

Yes, we should definitely add a convenience function, but I don't think it should be in the plugin, since it has nothing to do with it. But the plugin can make use of it.

@cemerick

@bbatsov I had a hand in writing that part of Leiningen's nREPL support ;-P Using clojure.tools.nrepl.server/default-handler is the-way-it's-done, at least if you have a bag of middlewares and want to get a handler out of them with reasonable defaults. You can always string together middlewares yourself, but the linearization of them (using the [perhaps suspect] dependency portions of their descriptors) is a tricky bit to get right.

@bbatsov bbatsov closed this in 081a99a
@pbostrom

Works great. Thanks!

@bbatsov
clojure-emacs member

@pbostrom You're welcome!

@cemerick Thanks for your input!

@pbostrom

@bbatsov Do you mind doing a deploy to clojars that contains this commit: 438655bad3bef1284b29b37a8eec73ac90ace91e ?

@bbatsov
clojure-emacs member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.