Fork me on GitHub
#cursive
<
2019-02-12
>
rodsenra00:02:42

I think a found a workaround.

rodsenra00:02:39

Instead of giving the debug config the alias for the runner (with -m app.main), I just give it the aliases that load all deps, and in the repl inside Cursive I trigger mount by hand with a (start). That works.

cfleming03:02:24

@mattmorten Yes, I definitely want to make that work, and hopefully soon. I’ve been put off implementing it by the fearsome complexity of rewriting CLJC ns forms with reader conditionals.

cfleming03:02:57

AFAIK the existing solutions only work for CLJ, not CLJS or even less CLJC.

cfleming03:02:09

@alexmiller @rodsenra Correct, Cursive doesn’t do anything with brew, except look for clojure where brew installs it by default.

cfleming03:02:41

I’m trying to reproduce this problem now.

cfleming03:02:10

@rodsenra This is a bug - Cursive has a problem in the way it assembles the classpath, it’s actually coming out as <big Java invocation> <flags, classpath etc> clojure.main -i <REPL init file> "-m red-robin.main"

cfleming03:02:20

Note the quotes around the last two args - they’re not being split correctly and are being added as a single string, so IntelliJ duly quotes it when it builds the classpath. So Clojure is trying to look for a file called -m red-robin.main, which it obviously can’t find.

cfleming03:02:43

I’ll fix that for the next release.

cfleming04:02:55

@rodsenra Actually, my apologies, I was incorrect - Cursive is fine 🙂

cfleming04:02:34

The problem is in your deps file: :main-opts ["-m red-robin.main"] should be :main-opts ["-m" "red-robin.main"]

5
cfleming04:02:23

I guess it works in the command line because of some accident of how the escaping works when the command line is assembled. IntelliJ is strict about quoting, but I guess clj is not.

Alex Miller (Clojure team)05:02:08

it’s due to how the opts get stored into a file and read back by bash

Alex Miller (Clojure team)05:02:46

which is actually a problem and the thing that causes options with spaces in them to NOT work the way they should

5
Alex Miller (Clojure team)05:02:12

so working accidentally (and likely to be broken by future changes)

souenzzo13:02:54

Feature idea: intellij-repl-api A lib that you require on REPL, then you can access intellij API's from REPL Example (idea/refactor-rename {:src-token :my/keyword :dest-token}) ;; will open the popup and i will click in "Ro Refactor"

rodsenra19:02:32

@cfleming and @alexmiller thanks a lot for the help. Splitting main-opts did the trick 👏 Sorry for the noise.

cfleming20:02:01

@souenzzo I’m actually planning something like this - I hadn’t considered refactoring, but I was planning things like invoking diff on two data structures etc.

👆 10
👏 20
souenzzo20:02:33

I lost some hours today doing refactor in a ton of keywords