cursive

Issues at: https://git.io/cursive-issues
2020-09-29T07:01:33.041600Z

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

kennytilton 2020-09-29T10:23:44.046700Z

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 Cruz 2020-09-29T14:24:22.052100Z

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

imre 2020-09-29T15:10:20.052800Z

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

Jovanny Cruz 2020-09-29T17:38:39.053200Z

Thank you!

cfleming 2020-09-29T20:07:45.054100Z

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

Jovanny Cruz 2020-09-29T20:11:50.054300Z

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

cfleming 2020-09-29T20:12:29.054600Z

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

👍 1
Jovanny Cruz 2020-09-29T20:13:51.054900Z

Sure, will do and post it here

Jovanny Cruz 2020-09-29T20:25:52.055100Z

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

cfleming 2020-09-29T20:27:15.055300Z

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 Cruz 2020-09-29T20:30:14.055500Z

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

Jovanny Cruz 2020-09-29T20:30:34.055700Z

Worth mentioning that the error says "Incorrect arity"

cfleming 2020-09-29T20:31:07.055900Z

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

Jovanny Cruz 2020-09-29T20:32:46.056100Z

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

cfleming 2020-09-29T20:33:25.056300Z

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

Jovanny Cruz 2020-09-29T20:35:15.056500Z

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

cfleming 2020-09-29T20:36:16.056700Z

Ok, there must be something else going on then.

Jovanny Cruz 2020-09-29T20:38:07.056900Z

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

cfleming 2020-09-29T22:46:43.057100Z

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