Fork me on GitHub
#cursive
<
2024-02-06
>
steveb8n01:02:01

Q: REPL commands w/ keybindings are great but some of my project specific commands are intermittently available. what is the criteria for when they are available?

Bob B02:02:22

at least a thing that can contribute to command availability: > Commands using substitutions will only be available when the substitutions they require are valid, for example a REPL command with ~selection in its text will not be available if there is no current selection.

steveb8n03:02:13

interesting. mine are forms that invoke thunks user.clj which are always available because I invoke them manually when the commands are flakey/missing

steveb8n04:02:41

oh. I just invalidated caches and they came back

steveb8n04:02:07

I’ll try this each time they go missing. hopefully not too often

steveb8n04:02:01

hmm. not available less than 30 mins later. @U0567Q30W any guesses why this feature would suffer from cache problems or anything else?

cfleming04:02:25

No, I’m not sure. Can you send a screenshot of one of the problematic ones? By DM if you prefer.

steveb8n04:02:07

nothing IP related so here it is

steveb8n04:02:05

the global cmd is always available but project specific cmds are present only after cache invalidate for a little while

cfleming04:02:31

Hmm, I can’t see anything, sorry. I’ll have to add some debug log to see what’s going on there.

steveb8n05:02:48

ok. I’ll keep invalidating and try to find a pattern

cfleming05:02:51

I’ll make some time tomorrow to get some logging in there and send you a dev build

🙏 1
steveb8n06:02:47

Fwiw this is not urgent if you prefer to add instrumentation to an eap build

steveb8n05:04:19

@U0567Q30W can we resume looking into this? Having commands available would save me some finger pain these days

steveb8n05:04:36

more context: I have 2 fns in a “repl” ns that I want to invoke as project specific commands. they are configured identically but only one of them appears in the commands popup

cfleming07:04:16

Ugh, sorry, I never got around to adding that logging.

cfleming07:04:28

Let me check.

steveb8n10:04:34

No worries. Thanks

thheller09:02:45

One problem I often run into is that Cursive gets a bit overeager which files it wants to sync when doing "sync files in REPL". Is there any way to reset what it is trying to sync? Reconnecting the REPL doesn't help.

thheller09:02:57

The problem being that for example I made a quick change to a file meant for a browser build, but then go back to working in my node repl. If I now hit sync it tries to load the browser file, which fails because it accesses browser things. Problem is that even if I hit sync again it tries to load that file again.

thheller09:02:25

Or working on a CLJ file which then still ends up as

Loading src/main/shadow/grove/components.clj... 
------ REPL Error while processing ---------------------------------------------
(cljs.core/load-file "C:/Users/thheller/code/shadow-grove/src/main/shadow/grove/components.clj")
can only load .cljs and .cljc files

thheller09:02:30

Reconnecting the REPL doesn't help, as soon as I press sync it just tries to sync all previous files again

thheller09:02:42

restarting idea works, but thats kind of annoying. maybe there is a keybind or something I can use to just reset what it is trying to load? or maybe send something like :cursive/reset-sync-files or so to the REPL?

thheller10:02:32

also getting this popup often when syncing files. sync itself even goes through, so no clue what this is about

thheller10:02:14

syncing files in a CLJS REPL definitely has issues

thheller10:02:41

is there any way to just make it do load-file calls and nothing else?

cfleming00:02:25

Hmm, I see, yes syncing when you’re switching REPLs probably won’t work well. I’m going to have to re-think how that works. Resetting the sync is a good idea, but I think it should be automatically reset on new REPL starts anyway, that causes unnecessary ns loads even when just using a single CLJ REPL.

cfleming00:02:50

If you use Load File in REPL rather than sync, that should only load the file you’re dealing with and its dependents if modified.

cfleming00:02:27

Sync is always going to be tricky with multiple REPLs. I can (and will) fairly easily stop it trying to load CLJS files in a CLJ REPL. But I’m not sure how to choose which REPL a file should go (or not go) to when you have multiple CLJS ones (e.g. browser and node).

cfleming01:02:05

In that dep cycle error, what’s the hex prefix on the ns?

cfleming01:02:09

It looks like maybe there’s an output directory which isn’t excluded?

thheller07:02:16

ah yes, that was some output dir of a :local/root dep that wasn't excluded. it wasn't on the classpath though, so not sure why cursive even looked at that.

thheller07:02:29

I'd be fine with manually resetting the sync files, or them being reset when connecting. just something better than having to restart intellij

wilkerlucio15:02:19

hello, one feedback about an update that happened when creating new namespaces, in the past, when I started from a package, I could just type the namespace and it would create at that level, but there was a change that now the full namespace shows up in the input, and it comes fully selected when the dialog opens:

5
wilkerlucio15:02:54

its a bit a nitpick, but since I have created the wrong namespace so many times, because before I could just type it, now I have to first press the right arrow to remove the selection, otherwise my namespace goes to root

wilkerlucio15:02:15

would be possible to keep the cursor at the end instead of selecting the whole text when this dialog for new namespace opens?

markbastian19:02:05

Yeah, I am constantly deleting the ns that I just created because it put it in the wrong place compared to what I am used to.

cfleming01:02:54

Yes, this is annoying. Unfortunately there’s no way to fix it without duplicating a bunch of platform code, but I think I’m going to have to do that.

jamescroft11:02:30

I’ve accidentally deleted the selected text so many times!

cfleming00:03:58

The fix for this is out now, in the latest EAP.

🎉 1