Closed stefan-toubia closed 4 years ago
Which version of reply are you using? This was a bug fixed in 0.4.4 - details in https://github.com/trptcolin/reply/issues/199
Oh! I'm on 0.4.3, thanks!
While I have you here, I've been trying to work reply into my workflow with calva. Right now if I start a standalone nrepl, nrepl automatically chooses a port and exposes a port you can connect to, as well as making an .nrepl-port
file.
nREPL server started on port 60959 on host localhost - nrepl://localhost:60959
I may have missed this but I did not see how to mimic this when using reply, is this supported?
Hmm, lein trampoline run
does use nREPL by default, and picks a random port. And then lein trampoline run --attach PORT_NUMBER
will let you attach to the same runtime.
I'm not sure there's currently a way to get that generated port number other than (a) doing the thing I did, where you lsof -nPi | grep java
and find the exposed port, or (b) if you're in the runtime, looking at (:port @reply.eval-modes.nrepl/nrepl-server)
. Details: https://github.com/trptcolin/reply/blob/445622358072bc6397ee13cad2f1c7833f577157/src/clj/reply/eval_modes/nrepl.clj#L156-L169
I don't think I'd want us to write an .nrepl-port
file explicitly, since that naming responsibility seems like it belongs all together wherever it lives (sounds like in the nREPL codebase), but I'm open to having some config where you could tell REPLy something like --write-port-file "path/to/file"
? I'd defer to @bbatsov though.
I'm going to go ahead & close this issue - feel free to open another (or a PR!) if the above answer doesn't get you what you need for connecting to a port!
Thanks again for the help!
Trying to start reply with a
--port
arg throws the following exceptionLooks like there needs to be a
:parse-fn
added to parse strings to int.https://github.com/trptcolin/reply/blob/445622358072bc6397ee13cad2f1c7833f577157/src/clj/reply/main.clj#L45