Fork me on GitHub
#cursive
<
2021-08-23
>
danm08:08:27

How am I supposed to use Tools -> REPL -> Send (function under caret) to REPL? If I try it when in the user ns, I get the error :namespace-not-found, even when the function is itself only using functions that are from clojure.core. If I first use Tools -> REPL -> Switch REPL NS to current file then the error is instead Unable to resolve symbol: defn in this context, which seems to be because by switching the REPL NS it's lost all of the references to clojure.core functions/macros. I'm sure this is something I'm doing wrong, rather than something broken with Cursive, but I don't know what that is

cfleming08:08:30

tl;dr: you need to make sure the namespace is loaded into the REPL.

danm08:08:52

facepalm Thanks! 😄

cfleming09:08:35

No worries - the usual confusion is that forms sent from the editor are (by default) executed in the namespace of the file they’re sent from, not the current REPL ns.

Jakub Holý (HolyJak)12:08:40

How to troubleshoot when Parinfer seems not to work? I press tab an expect the sexp to get idented (works) and the close paren of the sexp on the previous line to be moved after it (i.e. slurp) but this does not work. I only get a red underlining with "incorrect indentation for parinfer" 🙏 (FYI Slurping via paredit works but takes a few seconds, on this 40 line let ) Update: When I start writing eg. a defn then parinfer warns about incorrect indentation. So I guess my question actually is: How do I find where the indent. is wrong, and how best to fix it?

Jeff Evans14:08:35

I struggle with this too. Best advice I can offer is to look for the first red squiggly and start fixing from there downward

👍 2
cfleming21:08:39

When there’s incorrect indentation, you’ll see the indentation marked in red in the margin, like this:

cfleming21:08:53

You can jump to those with Navigate | Next Highlighted Error

cfleming21:08:23

Generally reformatting the code with the indentation problems will fix the issue.

Jakub Holý (HolyJak)21:08:19

Thanks a lot for the advice! Will try.

indy18:08:34

Babashka support is quite nice:v:

cfleming21:08:14

Thanks for letting me know! That’s the first feedback I’ve received, glad to know it’s working. Let me know if there are any issues.

👍 3
❤️ 3
Colin P. Hill19:08:30

oh there’s babashka support? well that’ll accelerate my plans to learn babashka. 👀