Fork me on GitHub
#cursive
<
2019-02-11
>
cfleming01:02:15

@vincent.cantin There is a plan to investigate it, yes. There are some interesting implications, because REBL has the GUI in the actual REPL process, whereas with Cursive the GUI is in an external process (IntelliJ itself). I still don’t know what the full implications of that are, so no promises.

👌 5
cfleming03:02:45

@kenny I’m testing the git lib missing SHA fix. However I can’t reproduce what you’re seeing - for me, if the SHA is invalid, then when I refresh the project the Build toolwindow pops up with a pretty clear message. Is there some other circumstance when that’s less visible?

kenny15:02:52

Yes. When using auto-import, it does not pop open the Build window.

cfleming00:02:35

@kenny I’ve investigated this, and I can’t see a way to fix it. Errors are deliberately suppressed for auto-import refreshes, presumably because errors are common while you’re editing build files. I can’t see a way to modify that behaviour.

cfleming00:02:59

The best workaround I can suggest is to manually refresh after changing SHAs, which does show the error.

cfleming00:02:55

Or just manually check the Build tab, I guess.

kenny00:02:16

Oh right, you wouldn't want to message the user while they are editing it. I hit this case all the time though -- I accidentally copy a SHA from the wrong repo or forgot to push a SHA -- and the results are confusing. Perhaps a better solution would be if you try and start a REPL after the refresh and the build failed, alert the user.

cfleming01:02:09

Doesn’t that already happen when the build fails?

cfleming01:02:34

I guess for most people, starting the REPL doesn’t actually build anything…

kenny01:02:59

Not sure. Lemme check.

kenny01:02:16

No it does not tell me. This is what I do: 1. Start with a valid git SHA 2. Change the SHA to an invalid one 3. Hit save & wait for the auto import to finish 4. Hit REPL play button 5. No error

cfleming01:02:52

Right. I’m not sure at which point there Cursive could realistically detect and show an error.

kenny01:02:37

Even printing a message in the actual REPL that the classpath is "stale" or does not match the classpath in deps.edn

cfleming01:02:41

But hold on - when you start the REPL in step 4, do you still get the previous classpath?

cfleming01:02:07

Ok, so that is a bug I can definitely fix.

kenny01:02:16

What should happen?

cfleming01:02:46

Once you’ve updated deps.edn, if you run a REPL from a Run Config that uses that deps.edn it should definitely use the new one.

kenny01:02:40

And what should happen if the deps.edn is not valid?

cfleming01:02:04

That will depend on what deps does, but I think it should show an error.

cfleming01:02:13

One sec, let me try this with my test project.

cfleming01:02:11

@kenny I can’t reproduce that. Here’s what I’m doing: 1. Create a deps project with a git dep with a valid SHA. Then sync it etc. 2. Running a REPL with this works fine. 3. Modify SHA to be invalid, press save, check in Build toolwindow that message appears. 4. Run REPL again, and I get an error Error creating Run Parameters, and a message in the Run toolwindow about the SHA.

cfleming01:02:39

I just fixed a bug where the message about the SHA in step 4 occasionally wouldn’t be shown, but under normal circumstances it would.

kenny01:02:45

I've never seen that message.

cfleming01:02:50

Let me try this with the current published version, in case the version I’m running has something fixed that’s affecting this.

artrmrno03:02:56

Hi, I'm trying to create a deps.edn project and got the error 'Cannot execute: Clojure command not configured'. I installed Clojure using brew on mac and the clojure command is in my PATH. Is there another PATH I have to set up in IntelliJ?

artrmrno04:02:41

Nevermind, I went to the 'Clojure Deps' settings, made a change to use 'toolds.deps' and then back to 'CLI' tools and I didn't get the error anymore.

butterguns19:02:11

Hi - I sent something to the mailing list, but I wonder if this would be a better place for it: is it possible the Organize Imports function will ever work. I would love Cursive to clean up my :requires and :imports

vemv20:02:59

I'm gonna extract the clean-ns op from https://github.com/clojure-emacs/refactor-nrepl for easy, editor-agnostic usage pretty soon. Keep an eye on #announcements ... maybe in a couple weeks?

parrot 5
butterguns20:02:58

I always wondered why "refactors" were tied to a specific editor, rather than being a framework that any editor could plug into

👍 5
vemv20:02:12

luckily refactor-nrepl is agnostic. but IIRC it still needs to talk over the nrepl protocol. I want to make it easier - just one fn call away from your repl

rodsenra21:02:26

Hi, I wonder if anybody had any trouble with Cursive v1.8.1-eap2-2018.3, tools.deps and Clojure 1.10.0.?

Alex Miller (Clojure team)21:02:56

perhaps you could explain what trouble you’re seeing?

rodsenra21:02:17

Sure. Let’me grab the details here

rodsenra21:02:38

clj -A:main
runs just fine from the shell. (using clojure 1.9.0 in deps) However from Cursive, I do get: Exception in thread “main” java.io.FileNotFoundException: -m red-robin.main (No such file or directory) when using from within Cursive

rodsenra21:02:02

I do have clojure 1.10 installed via brew

Alex Miller (Clojure team)22:02:53

does your deps.edn :paths match the root of your source?

rodsenra22:02:34

This is my deps.edn

:main
  {:extra-paths ["src"]
   :main-opts ["-m red-robin.main"]}

rodsenra22:02:12

Same structure on Cursive

rodsenra22:02:09

Cursive debug config

rodsenra22:02:29

I wonder if this is related to have clojure 1.9.0 in tools.deps, but also having clojure 1.10 installed by brew :thinking_face: I even tried to downgrade clojure to 1.9.0 but could not using brew.

Alex Miller (Clojure team)22:02:52

that shouldn’t matter at all

👍 5
Alex Miller (Clojure team)22:02:22

any brew installation should work with any Clojure version

rodsenra22:02:06

Using brew, I can only install 1.10. Could not figure out how to install 1.9 after 1.10 was released.

rodsenra22:02:18

My project currently does not run on 1.10

Call to clojure.core/ns did not conform to spec.
But I will investigate that later.

rodsenra22:02:07

After upgrading to 1.10, Cursive stopped working, that is why I suspected a relation. But I think Cursive also upgraded, so now I am not sure what was the cause.

Alex Miller (Clojure team)22:02:59

you can use something like brew switch clojure 1.9.0.397 to switch to a different (older or newer) version

rodsenra22:02:36

I have tried that, but got

Error: clojure does not have a version "1.9.0.397" in the Cellar.

rodsenra22:02:03

The only 1.9.0 that I have was installed by Cursive through maven

Alex Miller (Clojure team)22:02:17

well, it has to be a version you’ve installed in the past - brew info clojure

Alex Miller (Clojure team)22:02:39

I don’t think Cursive does anything with brew. you may be confusing two different things here

Alex Miller (Clojure team)22:02:11

Maven is used to download versions of the clojure jar (the language itself) - those versions are usually like 1.9.0 or 1.10.0

rodsenra22:02:21

I know. What I am saying is that on brew I can only get clojure 1.10

$ brew info clojure
clojure: stable 1.10.0.411
The Clojure Programming Language

/usr/local/Cellar/clojure/1.10.0.411 (9 files, 21.1MB) *
  Built from source on 2019-02-11 at 10:58:02
From: 
==> Dependencies
Required: rlwrap ✔
==> Requirements
Required: java >= 1.8 ✔
==> Analytics
install: 2,988 (30 days), 12,022 (90 days), 41,661 (365 days)
install_on_request: 2,949 (30 days), 11,821 (90 days), 40,716 (365 days)
build_error: 0 (30 days)

Alex Miller (Clojure team)22:02:43

brew is used to install a version of the clojure and clj tools which have versions like 1.9.0.397 or 1.10.0.411

rodsenra22:02:46

But in my deps.edn I have org.clojure/clojure {:mvn/version “1.9.0”}

Alex Miller (Clojure team)22:02:28

the tools are the things that let you run clojure or clj at the terminal

rodsenra22:02:58

Got it. I saw the source for the bash scripts.

Alex Miller (Clojure team)22:02:05

many tools (clj, lein, boot, Cursive, etc) may cause the Clojure jar to get downloaded and cached in the Maven repository

Alex Miller (Clojure team)22:02:35

that error you posted before (Call to clojure.core/ns did not conform to spec.) will prevent a namespace from loading, so is likely to be a problem for you

rodsenra22:02:01

That only happens when I change deps.edn from 1.9.0 to 1.10

rodsenra22:02:17

I will try to go deeper into what Cursive is trying to run, to check out why 1.9.0 is failing.

rodsenra22:02:31

Interesting. From the shell, both versions below do work

clj -m red-robin.main
clj -A:main
From Intellij, it breaks on:
Clojure 1.9.0
nREPL server started on port 64956 on host 127.0.0.1
Exception in thread "main" java.io.FileNotFoundException: -m red-robin.main (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
       ...
	at clojure.main.main(main.java:37)
Because it is passing “-m red-robin.main”from deps.edn straight to:
public static void main(String[] args) {
        REQUIRE.invoke(CLOJURE_MAIN);
        MAIN.applyTo(RT.seq(args));
    }

rodsenra22:02:07

Found a clue. The difference between Intellij and tools.deps from cmd line is:

-javaagent:/Applications/IntelliJ IDEA  IDEA 
Without it, it just works.

rodsenra22:02:35

That only means that Cursive is assembling the classpath just right, and invoking

clojure.main -m red-robin.main
as expected