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.
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)
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.
I suppose this is one way to do it:
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.
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.
@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.
[Fix #640] Add instructions for using CIDER with embedded nREPL servers
Works great. Thanks!
@pbostrom You're welcome!
@cemerick Thanks for your input!
@bbatsov Do you mind doing a deploy to clojars that contains this commit: 438655bad3bef1284b29b37a8eec73ac90ace91e ?