Fork me on GitHub
#cursive
<
2019-02-07
>
cfleming00:02:04

@caleb.macdonaldblack I assume you mean send them to the REPL, right? Which files would you want to do that for? All open editors, all in the project, or something else?

cfleming00:02:33

@pedrorgirardi I’m not familiar with Kick - how does it set that property?

cfleming00:02:39

Is it set via an alias?

cfleming00:02:00

@lennart.buit I haven’t used VisualVM in a while, but nothing I know of should cause that.

caleb.macdonaldblack00:02:03

all in project. Cascading down based on dependency

caleb.macdonaldblack00:02:22

a -> b -> c : reloading c reloads a & b also

caleb.macdonaldblack00:02:47

It's not a big deal if this isn't supported. My issue is with using 'def' anyway so it's probably poor design around that

cfleming00:02:49

In that diagram, a depends on b which depends on c, right? So you’re talking about reloading namespaces that depend on the one you’re loading?

cfleming00:02:23

Cursive currently doesn’t do that, no, but it would be very useful in some circumstances (things like multimethods, protocol implementations etc).

caleb.macdonaldblack00:02:45

I'm actually using protocols here which is contributing to this issues

caleb.macdonaldblack00:02:02

and pedestal routes need to be reloaded each time

caleb.macdonaldblack00:02:26

So if i change my protocol, i need to reload the protocol ns, any ns that used that protocol, the routes ns, and finally reload start and stop component to get new instances. That final one is necessary for how protocols work, but it's quite a few steps to go through

cfleming00:02:35

Does the routes ns depend on the protocol one?

cfleming00:02:56

Ok, so if reloading a ns also reloaded its dependent ones, then you could create a REPL command for the start/stop component, with sync files as the prior step, and I think you should be able to do the whole thing with a single key.

caleb.macdonaldblack00:02:58

Oh wow, I didn't know that existed

cfleming00:02:47

That doc is slightly out of date, but you get the idea.

cfleming00:02:48

The only thing with that is that it doesn’t currently do the dependent namespace part - that would have to be a more general enhancement to the sync files functionality.

caleb.macdonaldblack01:02:16

Wow that repl command functionality is incredibly useful

cfleming01:02:26

No worries, I hope it helps! If you could file an issue for the dependent namespace loading, I’ll try to take a look at that soon.

caleb.macdonaldblack01:02:46

Alright sounds good

pedrorgirardi01:02:18

Hi @cfleming. I think it’s the clj tool that sets that property. I found this http://insideclojure.org/2018/05/04/add-lib/ >System property clojure.libfile - referring to an edn file holding the lib map. clj will set this automatically for you and point to the cached lib map it’s using.

pedrorgirardi01:02:51

If I run from the terminal: (System/getProperty "clojure.libfile") => ".cpcache/3399073160.libs"

cfleming01:02:02

@pedrorgirardi How is your REPL configured - are you using the “Run with Deps” option?

pedrorgirardi01:02:18

Yes, using Run with Deps option.

cfleming01:02:23

Ok, one sec - let me check what that’s doing.

pedrorgirardi01:02:44

Sure. Thank you!

cfleming01:02:05

@pedrorgirardi Right, so the problem is that Cursive doesn’t use the clojure command to create the classpath when running tasks, and it’s the script itself which sets that system property. However it looks like I can support that by doing the same thing that the script does, more or less.

cfleming02:02:20

If you could file an issue for that, I’ll try to fix that shortly.

pedrorgirardi02:02:51

Yep, will do. Thank you very much @cfleming.

kenny18:02:45

I set a breakpoint in one of my dependencies and I am getting a message that says "No executable code found. " I'm running v1.8.1-eap2-2018.3. The project is a Clojure Deps project and the dep is a git dep.

stijn20:02:11

Hi, is it possible to use the REBL interface from a cursive REPL? I can't seem to get it to work with a clojure.main repl

stijn20:02:23

works! 🙂

stijn20:02:37

hmm, but you cannot send code from a file to the REPL

cfleming20:02:26

@stijn Thanks, I didn’t even know they had that documented!

cfleming20:02:46

@kenny Hmm, that can be flakey sometimes. Can you paste a screenshot of the line the breakpoint is on with the code from that line?

cfleming20:02:02

Feel free to DM me if the code is sensitive

Bo Chen21:02:26

Hi, Has anyone had luck launching repls (using leiningen) with lein-shell prep-tasks, and getting the working directory set properly? E.g. This project.clj

(defproject ...
:plugins [[lein-shell "0.5.0"]]
:prep-tasks ^:replace [["shell" "./script/run_some_checks.sh"]
                                          "javac"
                                          "compile"]
ends up trying and failing to launch the shell script from intelliJ's working directory /Applications/IntelliJ IDEA , rather than the project home directory. The rest of the REPL is using the the project home directory correctly. (I'm using OSX)

Bo Chen21:02:27

I confirmed that (System/getProperty "user.dir") is passed through as /Applications/IntelliJ IDEA to lein-shell. While in a repl launched without that prep-task, (System/getProperty "user.dir") is the project home directory.

kenny22:02:06

@cfleming Here's a screenshot.

kenny22:02:20

What is the Local REPL + Run with Deps option suppose to do? If I add an alias in that text box, it doesn't seem to get used in the REPL's CP.

cfleming22:02:57

@kenny Has that namespace been loaded into the REPL?

cfleming22:02:19

Often breakpoints appear like that before the namespace is actually loaded.

cfleming22:02:56

The aliases in that textbox should definitely affect the classpath, if not that’s a bug for sure.

kenny23:02:07

This dep had never been downloaded before so that could be related.

kenny23:02:55

Even after downloading the dep via the CLI, it still doesn't appear in the CP. This is the alias {:oz {:extra-deps {metasoarous/oz {:mvn/version "1.5.6"}}}}. I have REPL type nREPL and Run with Deps selected. I pass oz to the Aliases text box. After clicking the Play button, the REPL opens and metasoarous/oz is not on the classpath.

kenny23:02:35

If I do clj -A:oz then (require '[oz.core]), it works.

cfleming23:02:50

Ok, let me try that.

kenny23:02:44

FWIW, this works too clj -Aoz

cfleming23:02:09

Wow, that’s a lot of deps

cfleming23:02:27

That Oz pulls in.

kenny23:02:36

Yeah... That's actually why I wanted a separate REPL for Oz 🙂

cfleming23:02:01

That works for me.

kenny23:02:31

Oh, shoot - I had the wrong module selected. Is there a way Cursive could have told me the alias I tried using didn't exist?

kenny23:02:41

Similar to the CLI

kenny23:02:00

clj -A:idontexist
Error building classpath. Specified aliases are undeclared: [:idontexist]

cfleming23:02:12

So Cursive actually filters them internally, and I’m trying to remember why.

cfleming23:02:28

I think it was to do with propagation for :local/root deps.

cfleming23:02:44

But it should warn if the aliases don’t exist in the root project, yes.

kenny23:02:27

Yes - it has been loaded.

kenny23:02:43

... through a :require. It's not the ns I am loading.

cfleming23:02:17

Still, that should be enough to make it work. Do any of the previous or subsequent lines work?

kenny23:02:46

Every line in that namespace does that.

kenny23:02:15

Another item that has been a bit annoying with the Deps integration is is I have a git dep with a valid sha and then change it to an invalid sha, the auto import won't pop up and tell me that the sha is invalid.

cfleming23:02:01

Hmm, I wonder if that’s actually possible to determine. Doesn’t deps itself warn about that?

cfleming23:02:13

But you don’t see that in Cursive?

kenny23:02:28

I see it if I actually go down to the Build tab and open it.

kenny23:02:42

I would've expected it to pop open with an error.

cfleming23:02:45

I’ll try to fix that too.

❤️ 5