Fork me on GitHub
#cursive
<
2020-09-29
>
andrzejsliwa07:09:33

is there any way to eval in place (in editor) in for ex. in comments (similar to CIDER behaviour) without going to REPL window?

kennytilton10:09:44

Yes, but only after you bring up a REPL. Then Tools>repl>(various options to send things to repl) will be available. I mean, it still “goes to the repl”, but I do not have to 🙂. Also, not sure if you meant “…and dump the output into my source file”. I do not know if Cursive does that. btw, Instead of a text comment involving ;;; I use the clojure comment form to hold snippets. Then I do not have to select a form to evaluate, just position the cursor in/after the form. Cursive then evaluates the ouermost form around the cursor, excluding comment of course.

Jovanny Cruz14:09:22

Hello! Apparently my cursive installation (or IDEA) is not able to recognize some functions that are declared using https://github.com/plumatic/schema like (s/defn my-function...). IDEA keeps marking functions calls in red and complains about the arity even if the number of arguments is correct. Is there any way to solve this problem? IDEA version 2020.2.2 Cursive version 1.9.3-2020.2

imre15:09:20

Hey there. You should be able to teach cursive about these, see https://cursive-ide.com/userguide/macros.html

cfleming20:09:45

Cursive should support those out of the box, though. @U0168NRNKDJ Is your project available anywhere to look at, or is it private?

Jovanny Cruz20:09:50

The repo is private, unfortunately, but even with Imre's suggestion, IDEA keeps complaining 😕

cfleming20:09:29

Could you create a small repro repo that shows the problem?

👍 3
Jovanny Cruz20:09:51

Sure, will do and post it here

Jovanny Cruz20:09:52

In the small repo IDEA and Cursive works just fine, I just needed to click on "resolve as defn", but in the repo of the company I work for they do not work

cfleming20:09:15

Resolving as plain defn won’t work, because it’s not aware of the type hints. But Cursive does include support for schema, which is why I’m surprised it doesn’t work out of the box. Have you vendored schema under a different namespace, or anything like that?

Jovanny Cruz20:09:14

Schema is imported using [schema.core :as s], as usual

Jovanny Cruz20:09:34

Worth mentioning that the error says "Incorrect arity"

cfleming20:09:07

Ok, I’ll take a look at the repro and see if I can figure it out.

Jovanny Cruz20:09:46

Thank you! BTW, my teammates can open up the exact same repo but using an older version of IDEA (2019) and no complaints appear

cfleming20:09:25

That’s very strange. One thing you could try is File->Invalidate caches and restart, it’s possible your indexes have gotten funky.

Jovanny Cruz20:09:15

I've tried that but it does not seem to work

cfleming20:09:16

Ok, there must be something else going on then.

Jovanny Cruz20:09:07

Please, ping me in case I can help in any way

cfleming22:09:43

Sure, the most important thing is just a repro case - hopefully I can figure it out from there.