Fork me on GitHub
#cursive
<
2022-08-11
>
olttwa06:08:13

Hey @cfleming Firstly, thank you for creating such an awesome plugin in Cursive. I'm developing a project Goose: https://github.com/nilenso/goose Apart from src & test folders, I've created a separate folder for load-testing called perf I've added perf folder to Source root as can be found in goose.iml However, upon restart, IntelliJ won't compile with a warning & I've to re-add perf to Source root every time. > File load.clj is not under a source root Any idea why IntelliJ does that & how to fix this?

cfleming06:08:48

Thanks for the kind words! It looks like goose is a deps project, so you probably want: https://cursive-ide.com/userguide/deps.html#working-with-aliases

👍 1
olttwa06:08:22

@cfleming I added all aliases in the Clojure Deps toolwindow, added load.clj as source root & restarted IntelliJ. Still I'm facing same issue.

olttwa06:08:41

I cannot even load the file into REPL despite it being configured in REPL's config

olttwa06:08:11

It works after I've done Add source root in IntelliJ

cfleming07:08:15

@U03HVBGMRJ5 When you select the aliases in the toolwindow, you don’t have to restart IntelliJ, just refresh the project from the toolwindow. So, could you open the toolwindow and refresh the project now?

cfleming07:08:34

Once you’ve done that, does the perf folder appear as a source root? It should be the same colour in the project view as the src folder.

olttwa10:08:45

> just refresh the project from the toolwindow Doing this doesn't fix the issue > Does the perf folder appear as a source root? It should be the same colour in the project view as the src folder This happens only after I click on Add Source root from IntelliJ, not by adding the alias from Deps toolwindow

olttwa10:08:28

@cfleming all these changes disappear upon restart 😓

cfleming21:08:09

One thing I’ve just noticed, shouldn’t the key in the :perf alias be :extra-paths instead of :paths in Goose’s deps.edn?

olttwa07:08:46

@cfleming modifying Clojure Deps tool window & s/:paths/:extra-paths/ fixed the issue. cc @U38004EG7 I had modified :perf alias in the past to see if :paths worked. Thanks a lot :hugging_face:

👍 1
Ernesto Garcia08:08:49

Hi all. Is there a way to see REPLs side by side, instead of overlapping tabs? I would want to see Clojure and ClojureScript REPLs at the same time if possible.

cfleming09:08:28

So, there isn’t at the moment, but JetBrains have recently added the ability to do that in toolwindows and I’m planning to add it for REPLs. There are some open UX questions about how it should work. Currently, sending forms to the REPL send to the currently selected REPL, which is harder to determine if there are multiple REPLs visible at once.

cfleming09:08:32

Another option is to allow the user to open the REPL in a normal editor rather than a toolwindow, then you could just arrange them using the normal editor arrangement commands. It still has the same problem of identifying where to send forms etc.

Ernesto Garcia10:08:09

Yes, sending automatically to the proper REPL would further accelerate development. Sending based on to what module the file belongs could be a nice first guess. Doesn't work for multiple REPLs running from the same module of course. In that case, the last one might be a good guess. I'm not sure if many people use to have several REPLs for the same module.

cfleming21:08:28

Well, having one for clj and another for cljs would be a common use case. When sending forms from clj or cljs the correct one could be chosen based on the file type, but cljc is trickier.

souenzzo09:08:34

Any news on this ticket? https://github.com/cursive-ide/cursive/issues/1918 There is some trick to run midje facts in cursive REPL?

cfleming09:08:28

I’m very unlikely to support Midje. It has been effectively dead for ages and is a tangled mass of macros. Sorry 😞

🆗 1
Joel17:08:17

@cfleming What is “Run ‘x-test’ in REPL” doing? I was curious if I could get a macro that evaluates to a deftest to be evaluated similarly.

cfleming21:08:17

I think you can run Midje tests by just using deftest directly and having Midje assertions in the tests.

roklenarcic11:08:51

After upgrading to JDK17 I get these errors after each expression in REPL:

Error updating class definitions:
Execution error (NullPointerException) at java.util.concurrent.ConcurrentHashMap/get (ConcurrentHashMap.java:936).
Cannot invoke "Object.hashCode()" because "key" is null

markaddleman11:08:07

Are you using tools.namespace? I sometimes see this when reloading namespaces. I have never investigated but it seems to be some kind of race condition and the error has not impacted my development.

roklenarcic11:08:40

I don’t get it when running JDK 8 or 14, but always when using 17, so that looks a bit less than a race condition then

salam03:08:08

we've been using Java 17 at work shortly after it was released and have never seen this error. is it possible for you to post the full stack trace?

roklenarcic09:08:27

I cannot, because it doesn’t happen on the same thread

roklenarcic09:08:39

if I say *e it just returns nil

folcon16:11:41

Not sure if this was ever solved, I've just started getting this error as well appearing...

Connecting to remote nREPL server...
Clojure 1.11.1
Error updating class definitions:
Execution error (NullPointerException) at java.util.concurrent.ConcurrentHashMap/get (ConcurrentHashMap.java:936).
Cannot invoke "Object.hashCode()" because "key" is null
*e
=> nil
Error updating class definitions:
Execution error (NullPointerException) at java.util.concurrent.ConcurrentHashMap/get (ConcurrentHashMap.java:936).
Cannot invoke "Object.hashCode()" because "key" is null
So this is connecting to a shadow-cljs nrepl running:
openjdk version "19.0.1" 2022-10-18
OpenJDK Runtime Environment Homebrew (build 19.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 19.0.1, mixed mode, sharing)

onetom19:11:56

I saw the error lately, but it happens very rarely

onetom19:11:37

im on M1 macOS 13.0.1 (22A400) /nix/store/280df465g5isik8ljjnc8c31ncq2s4is-zulu17.34.19-ca-jdk-17.0.3/bin/java

folcon20:11:17

Ok, good to know :)

roklenarcic11:08:59

anyone else got these?

folcon16:11:41

Not sure if this was ever solved, I've just started getting this error as well appearing...

Connecting to remote nREPL server...
Clojure 1.11.1
Error updating class definitions:
Execution error (NullPointerException) at java.util.concurrent.ConcurrentHashMap/get (ConcurrentHashMap.java:936).
Cannot invoke "Object.hashCode()" because "key" is null
*e
=> nil
Error updating class definitions:
Execution error (NullPointerException) at java.util.concurrent.ConcurrentHashMap/get (ConcurrentHashMap.java:936).
Cannot invoke "Object.hashCode()" because "key" is null
So this is connecting to a shadow-cljs nrepl running:
openjdk version "19.0.1" 2022-10-18
OpenJDK Runtime Environment Homebrew (build 19.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 19.0.1, mixed mode, sharing)