cursive

Issues at: https://git.io/cursive-issues
mikejcusack 2021-03-14T04:10:59.173700Z

I believe it's only able to be done project-wide.

Azzurite 2021-03-14T18:02:24.175Z

what has to happen for automatic require/autocomplete to work? I don't understand why it's picking up some libraries I've been using but not others

Azzurite 2021-03-14T18:02:34.175200Z

and new ones are never picked up

mikejcusack 2021-03-14T20:50:43.175300Z

Are the maven repos indexed?

dazld 2021-03-14T21:18:36.176200Z

when loading a file/namespace into the repl, is there any way to make cursive reload any namespaces that require that one too?

cfleming 2021-03-15T22:11:54.188700Z

You can also use Tools | REPL | Sync files in REPL, as recently discussed: https://clojurians.slack.com/archives/C0744GXCJ/p1615790200178200?thread_ts=1615527556.163100&cid=C0744GXCJ

đź‘Ť 2
dazld 2021-03-15T23:26:54.189600Z

@cfleming thanks - almost exactly what I wanted, but unfortunately the other way around - I want to reload namespaces that depend upon the one I’m working on - I’m working on some macro related stuff, and want the consumers of the macro to reload, so they get the new behaviour. it’s pretty dull having to go through each of the consumers and reload them..

dazld 2021-03-15T23:29:26.189800Z

The clojure.tools.namespace.repl/refresh approach and the (require '[the-ns] :reload-all) approaches both didn’t end up working out. I think the require... approach is reloading dependencies of the namespace (..right?), so not quite right, and the namespace.repl/refresh thing just didn’t seem to work - suspect it was a problem with retained vars in some places, but even restarting the system as part of it didn’t work.

dazld 2021-03-15T23:29:35.190Z

(wall of text, apologies)

cfleming 2021-03-15T23:29:56.190200Z

Yeah, there are some other use cases like this too - things like updating protocols and multimethods.

đź‘Ť 1
dazld 2021-03-15T23:33:40.190500Z

all three of those are some of the most fun bits of clojure too!

dazld 2021-03-15T23:41:48.191900Z

As a suggestion, some kind of tree reload might be great, both backwards with dependencies, and forward with dependents.

cfleming 2021-03-15T23:42:38.192100Z

Yeah, I can see that being useful. It would be pretty easy to accidentally reload your whole app, though, although I suppose that’s what you want if you’re changing some fundamental macro at the bottom of the pile.

dazld 2021-03-15T23:43:27.192700Z

It’s a trade off, for sure.

borkdude 2021-03-15T23:49:09.194500Z

Reloading your entire app is pretty easy: (require your.main :reload-all)

borkdude 2021-03-15T23:49:39.194800Z

I use this a lot from the REPL actually when I make such changes

dazld 2021-03-15T23:51:46.196600Z

Have unplugged now, but will try that later @borkdude thanks

dazld 2021-03-15T23:52:45.198100Z

Even a single level of dependents would be handy to reload, without traversing the whole tree..

dazld 2021-03-15T23:59:05.201900Z

“Reload direct dependents” would work great, the more I think about it. If I know I need to go further, navigate and execute that command iteratively is straightforward.

mikejcusack 2021-03-16T20:54:35.000900Z

There is also clojure.tools.namespace.repl/refresh-all , which seems like what you're looking for

mikejcusack 2021-03-14T21:34:33.176300Z

Best thing is to use clojure.tools.namespace.repl/refresh for that

đź‘Ś 1
dazld 2021-03-14T21:44:19.176600Z

thank you, that looks perfect.

borkdude 2021-03-14T22:07:30.176900Z

you can also just use (require '[the-ns] :reload-all)

borkdude 2021-03-14T22:07:39.177100Z

in the repl

dazld 2021-03-14T22:21:32.177300Z

thanks, i’ll give that a go too

Azzurite 2021-03-14T22:38:25.177500Z

yes

Azzurite 2021-03-14T22:39:39.177700Z

and also cursive has the possibility under "tools -> REPL" to add a REPL command, i.e. code that gets executed in the current REPL, which you can then bind to a keyboard shortcut or add to a macro

👆 1