Fork me on GitHub
#cursive
<
2020-05-12
>
indy09:05:09

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?

indy11:05:39

Works fine in cider

cfleming01:05:16

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

indy08:05:34

@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

indy08:05:24

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

Connecting to remote nREPL server...

kenny13:05:10

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)
-------------------------
user/my-add
([x y])
  Adds x and y together, returning the sum.
Spec
  args: (cat :x int? :y int?)
  ret: int?

kenny13:05:55

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?)

danzurawski15:05:16

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

https://groups.google.com/forum/#!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?

cfleming01:05:11

That’s actually not my message, the previous one: https://groups.google.com/d/msg/cursive/iTri7vvXViA/SZkyw6GlDAAJ is from me, and explains how to actually make the connection. 5 years on, I should have this properly documented by now.

cfleming01:05:07

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.

danzurawski08:05:00

@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 😊

cfleming09:05:25

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.

boris15:05:45

Is there any way to have Cursive format code according to bbatsov’s clojure-style-guide? Specifically, adhering to its https://github.com/bbatsov/clojure-style-guide#body-indentation vs https://github.com/bbatsov/clojure-style-guide#one-space-indent 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?

cfleming01:05:18

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

cfleming01:05:41

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

boris14:05:44

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.

cfleming21:05:44

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

roklenarcic09:05:06

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

dvingo15:05:13

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

dazld16:05:34

have to buy a full size keyboard! 🙂