Fork me on GitHub
#cursive
<
2019-02-13
>
grzm15:02:36

Is there a way to connect to a socket repl (`clojure.server.repl`) via Cursive? From what I can tell, Cursive expects remote repls to be nREPL connections. When I start a clojure.server.repl via the clj command line tool, I can connect to it via inf-clojure in Emacs, but I can't via Cursive using the same host/port config. The longer version of the story is I'm trying to help a colleague running Windows to get started with Clojure with Cursive and we need to be able to use tooling around clj (which we're currently doing in WSL).

grzm17:02:25

Looks like one solution might be using https://github.com/mfikes/tubular

jffry20:02:21

Yes! What I've done: 1. Add a new profile to ~/.lein/profiles.clj like this {:tubular {:dependencies [[tubular "1.3.0"]]}} 2. In IntelliJ, Run > Edit Configurations 3. [+] button on left > Clojure > Local REPL, and give it a useful name 4. For Which type of REPL pick clojure.main 5. For How to run it pick Leiningen 6. Set Profiles to tubular 7. Set Parameters to -m tubular.core -p 12345 8. OK to save, then fire it up

kennytilton18:02:39

Dummies question here. I am using Cursive to interact with a server app that kicks off a voluminous query every few seconds. My work keeps scrolling away! 🙂 Yesterday (my first time trying) I did some accidentally and the output ceased, but it's back. Is there some way to just open a second repl? Or can anyone guess what I did yesterday? 🙂 Thx!

grzm18:02:43

A couple of things come to mind: sounds like if you're seeing output in the repl due to some async process, what you're seeing is logging output, correct? You could set up separate logging options for your local setup, I believe. There's also a button in the REPL window with a couple of lines with a down arrow which toggles auto scroll. In my window it's between the trash can button and the red "stop" square. You might want to toggle auto scroll off while you're inspecting a particular part of the REPL. I'm a Cursive newbie, too, so there may be more effective ways to handle this, but those are the two that immediately come to this still-ignorant mind.

kennytilton18:02:03

Thx! Yeah, I had some luck with the scroll toggle. Anyway, not sure what I did, but after kicking off the server I saw I had a second REPL tab that was nice and quiet. Hopefully that is how it always works! Thx again.

grzm18:02:07

Oh, and yeah, you can just add a new REPL as you already figured out. 😉 I personally sometimes get which repl is which in those situations, but that's a different issue.

jsabeaudry18:02:45

Anyone could figure out why tpope/lein-dotenv does not work in cursive?

gfredericks18:02:51

has anything big happened with cursive and custom macros over the last year or so? like support for breakpoints or formatting or other things like that

hmaurer20:02:53

Oops, wrong channel :face_with_rolling_eyes: I deleted the above

cfleming22:02:34

@grzm Yes, tubular is the best workaround for now, but I’m planning to add native support soon.

❤️ 5
grzm23:02:59

Thanks for the confirmation!

cfleming22:02:20

@jsabeaudry781 I haven’t tried it - what is the problem?

cfleming22:02:17

@gfredericks One thing that has happened in recent versions is that you can now use breakpoints inside methods of deftype-alikes, which didn’t work previously.

cfleming22:02:26

Do you have something specific you’d like fixed?

cfleming22:02:56

Macro support is getting incrementally better over time, but is still not totally general.

jsabeaudry22:02:49

The plugin is loaded but that plugins sets environment variables but they aren’t in the process afterwards

jsabeaudry22:02:07

If we do lein repl it is fine

cfleming22:02:05

Hmm, that might be because Cursive uses a different method of starting the final process. Could you file an issue for that and I’ll look at it?

jsabeaudry22:02:52

A colleague of mine will file it in a few minutes

jsabeaudry22:02:56

Thanks a lot!

gfredericks22:02:56

@cfleming the most recent thing was a coworker observing that breakpoints don't work inside schema.core/defn but later somebody pointed out it's not hard to downgrade it to clojure.core/defn while debugging