Fork me on GitHub
#cursive
<
2018-08-22
>
hagmonk02:08:57

@cfleming how does one add a module to the scope of the current REPL? I could have sworn I figured out how to do this, but no longer …

cfleming02:08:13

@hagmonk The scope of the current REPL is basically a module. So as long as the REPL’s module depends on the new one, it should be automatically in scope. You’ll have to restart the REPL after adding it, though.

hagmonk02:08:42

Hmm, that’s definitely the case already. I can eval expressions just fine, but Load file in REPL keeps complaining that the file isn’t in the right scope …

cfleming02:08:00

So this works weirdly in deps because of how the propagation works - it doesn’t actually use a module dependency but creates a library with the source roots from the other module and depends on that instead. I wonder if that is breaking things.

cfleming02:08:40

So you have modules A and B, A depends on B using :local/root and you can’t load files from B into a REPL run using A?

hagmonk02:08:14

That’s correct. Let me kill this REPL and just make sure I’m not hallucinating

hagmonk02:08:00

Yeah confirmed, I required a B namespace in A’s core.clj. Loaded A’s core.clj just fine. I jumped to definition of B’s ns from A’s core.clj, taking me to B’s core.clj. Tried to load file into REPL and it claimed B’s core.clj wasn’t in scope

cfleming02:08:16

Ok, let me try that.

hagmonk02:08:18

I can eval single forms from B just fine, though

cfleming02:08:46

Yeah, only file loading has that check

hagmonk02:08:58

ah ha, so my hallucinations must be explained by means not related to Cursive

cfleming02:08:24

Ugh, so this is really funky

cfleming02:08:47

The standard “with libraries” scope only gets classes out of it, not sources.

cfleming02:08:13

That’s going to be annoying.

hagmonk04:08:55

@cfleming aww that’s a pain. My first thought though was: can it not just pick the last active REPL and send the file there? But then I wondered about the semantics of multiple REPLs, and worse, multiple REPLs who share a common dependency … I think the hallucinations are starting again …

cfleming04:08:50

Yeah, it’s a bit tricky - this feature was basically to prevent confusion when users have multiple REPLs open.

cfleming04:08:18

But it’s not impossible to solve, I just have to figure out how to bend IntelliJ to my will.

cfleming04:08:05

@hagmonk Phew, fixed for the next EAP.

😍 1
cfleming04:08:17

JetBrains had my back in the end.

1
hagmonk04:08:58

And I just renewed my subscription today, so I can actually get that update :)

hagmonk05:08:09

Hmm random question - is there an equivalent of CIDER’s command to evaluate the expression in the REPL and put the results in the current buffer? I find myself using that quite a bit when writing tests, missing it now that I’m back in Cursive full time

cfleming06:08:41

@hagmonk So not at the moment. The problem is that you get a combinatorial explosion of “Evaluate top form/form before point/selected form and then output it/add it as a comment/replace the original with it” etc. I have a plan to extend REPL commands to allow these sorts of combinations to be created.

cfleming06:08:22

Another workaround solution (also useful for other things) would be a “Copy last command output” action which you could then paste.

joel15:08:53

hello all, is there any way to step/debug withing records? for some reason my breakpoint is marked as invalid when putting it in a record code

joel15:08:59

same for go-blocks

sparkofreason16:08:50

I'm running Cursive on Windows, but most of my CLI environment runs in WSL. Any thoughts on making this work short of a Windows version of clj?

conan16:08:21

I have this setup; I share my project directories between Windows and WSL without any trouble. I think I end up with two maven repos, but ¯\(ツ)

conan16:08:13

just remember to set git's core.autocrlf to input - you never really want CRLF anywhere

conan16:08:54

Oh I also have to set my env vars twice, but I actually never run REPLs from the WSL environment because the cursive one is so much better

sparkofreason16:08:12

Thanks, I forgot to mention I was referring to the deps.edn support. Does that work for you? I have the setup you describe, and it does work great except for deps.edn.

sparkofreason16:08:37

^^^Should have mentioned I was referring to deps.edn support.

richiardiandrea18:08:02

so I am configuring a shadow-cljs with shadow

richiardiandrea18:08:08

and I go to Run conf

richiardiandrea18:08:42

is this running a shadow-cljs watch build or just a normal nrepl build?

richiardiandrea18:08:48

(I guess the latter)

richiardiandrea18:08:45

and is there a way to launch a deps.edn repl with the new Cursive?

richiardiandrea18:08:02

I see a Clojure Deps configuration

richiardiandrea19:08:42

and I still see I need project.clj with lein-tools-deps in there or the deps are not actually resolved

cfleming22:08:05

@joelmarty2 Unfortunately that doesn’t work because of the way Clojure generates its classnames. I have a plan to fix it but haven’t managed to yet.

joel07:08:51

thanks for the answer. Keep up the good work 🙂

cfleming22:08:10

@dave.dixon I’m hoping you should be able to make this work. Here’s the plan:

cfleming22:08:12

1. Settings-&gt;Build, E, D-&gt;Build Tools-&gt;Clojure Deps-&gt;Global settings-&gt;Use tools.deps directly and pick a version.

cfleming22:08:58

2. In that same config, point Cursive to your user deps.edn. Cursive should only need to read it so I think you could put it under WSL, otherwise put it in Windows somewhere and point your WSL version to it using CLJ_CONFIG.

cfleming22:08:27

Cursive should now work with tools.deps, and hopefully they can interoperate ok. You may end up with two maven caches, or it may be possible to tell the WSL CLI to use your Windows one.

cfleming22:08:59

Let me know how that works!

cfleming22:08:06

@richiardiandrea There isn’t yet, no, but it mostly works. The case that doesn’t work yet is if you want to use different aliases to run your REPL than you want to use to sync the project to Cursive.

cfleming22:08:57

But you don’t need a project.clj now, as long as you’re running the EAP - some very brief instructions are here: https://groups.google.com/d/msg/cursive/NQIJzhGjfEY/hdNXUco8CgAJ

cfleming22:08:51

If you want to use an alias with :main-opts, you can work around that by manually entering “JVM Args” in the REPL run config.

richiardiandrea22:08:26

oh ok cool then, I will be trying this

richiardiandrea22:08:43

thank you for now, will ask if something does not work 😄

richiardiandrea23:08:17

@cfleming ups, I receive: Could not initialize class com.intellij.externalSystem.JavaProjectData

richiardiandrea23:08:53

oh looks like it is not finding the executable

richiardiandrea23:08:31

uhm no, still not really working...

richiardiandrea23:08:00

Can't find bundle for base name messages.JavaCoreBundle, locale en_CA

richiardiandrea23:08:11

will open an issue