Fork me on GitHub

I can’t connect to a REPL running in a remote server when port forwarding it to a localhost port. Does anyone else face this issue?


Works fine in cider


I can’t think of any reason that shouldn’t work. What happens when you try this?


@U0567Q30W I get the following error

Connecting to remote Socket REPL...
EOF while trying to sync input stream.
Disconnected from remote server.
Exception while trying to sync input stream: .SocketException: Socket closed


If I chose nREPL instead of socket repl it is always stuck with this

Connecting to remote nREPL server...


I never really use clojure.repl/doc since Cursive has the great built-in quick doc functionality. I did recently learn that clojure.repl/doc shows the function's :args and :ret as defined by a fdef. It would be awesome if Cursive could do the same! Here's an example output of clojure.repl/doc :

(clojure.repl/doc my-add)
([x y])
  Adds x and y together, returning the sum.
  args: (cat :x int? :y int?)
  ret: int?


Function's source:

(defn my-add
  "Adds x and y together, returning the sum."
  [x y]

(s/fdef my-add
  :args (s/cat :x int? :y int?)
  :ret int?)


Hello 🙂 Has anyone tried using Cursive for remote debugging (e.g. via nREPL host/port)? It seems that selecting nREPL effectively disabled/greys out the debug option in . This is for a Dockerised environment I am currently running. Alternatively, I tried using the standard (non REPL) remote debugger on a Java debugger port - the breakpoints seem to work, however, sometimes variables show as null. My understanding is that in order to have the debugger working well, you have to connect to the REPL debugger or is connecting to standard agentlib debugger port (Remote Debug) the same?

danzurawski15:05:44!msg/cursive/iTri7vvXViA/veDAU6qlDAAJ So e.g. in this user group thread, Colin suggested connecting to 5005 using a standard Remote Debug - so is there any difference between the two in terms of debugger capabilities?


That’s actually not my message, the previous one: is from me, and explains how to actually make the connection. 5 years on, I should have this properly documented by now.


But the critical bit to understand is that the debugger and the REPL are totally separate and use separate connections. The REPL does the evaluation part, and then debugger does the debugging bit.


@U0567Q30W Thank you for responding! I am very impressed with the plugin, it's got much better since I used it last time a few years back and I was able to make it all work with the debugger via socket attach as per your post. So do you think it's safe to say that as far as debugging 'working' is concerned, it should work as good as when started via 'Debug "REPL"'"? I assume so, as you said the debugging and repl are totally separate. That would mean I can safely argue that you can wholly run a dev Clojure inside docker and not lose any debugging capabilities 😊


Thanks for the kind words, I’m glad Cursive works well for you! Yes, that’s right, the debugger is totally equivalent when run remotely and when starting the process explicitly.


Is there any way to have Cursive format code according to bbatsov’s clojure-style-guide? Specifically, adhering to its vs indentation rule where it suggests having only a single space indent when there are no arguments on the same line as the function, but a 2-space indent when dealing with bodies of forms that have body paramaters?


That’s at Preferences | Editor | Code Style | Clojure | General | One space list indent


That one is contentious, and I maintain that it’s a bad idea propagated by emacs, but that might just be me.


It’s definitely not just you! I think the Cursive defaults are much nicer than what this styleguide suggests. I’m just trying to play well with the team if we stick to this guide.


Sure, hopefully all the options should be there to match e.g. Emacs. If you find you’re missing something, let me know.


the rule is not even automatically enforcible… plenty of macros have 2 space identation, but not all


anyone know how to type the diagonal arrows (on mac)?


have to buy a full size keyboard! 🙂