pallet / ritz

SWANK and nREPL servers for clojure providing JPDA based debuggers
318 stars 33 forks source link

nrepl-doc and nrepl-macroexpand-1 don't work with nrepl-ritz. #72

Open cola-zero opened 11 years ago

cola-zero commented 11 years ago

Hi! I noticed that these commands are not working with lein nrepl-ritz, but work file with lein repl. When I use nrepl-ritz-jack-in, nrepl-doc(C-cC-d) raise error in *nrepl-doc* buffer shown bellow.

ClassNotFoundException clojure.repl  java.net.URLClassLoader$1.run (URLClassLoader.java:366)

And nrepl-macroexpand-1 show nothing (nor any error buffer).

This is because clojure.repl and clojure.pprint are not required. When I require these libraries, they work perfect. I think ritz-nrepl should require these libraries by default. Does anyone have same issue? Ando how do you think about that?

hugoduncan commented 11 years ago

The ritz server can be used in a variety of situations, and it may not always be appropriate to require clojure.repl and clojure.pprint. I think the nrepl client (I'm assuming this is with nrepl.el) should be explicitly requiring these namespaces.

I also think we should have middleware for these operations.

cola-zero commented 11 years ago

I understand that ritz not require them by default.

I also think we should have middleware for these operations.

I can't understand it, because I don't write and understand middleware yet. The middleware will check namespaces in every eval operation?

hugoduncan commented 11 years ago

Middleware works by having the client specifically invoke a middleware operation. So in this case, it would invoke a :macroexpand operation, and leave the implementation to the middleware.