Fork me on GitHub
#cursive
<
2024-04-08
>
Simon09:04:45

@cfleming Hi, I've just updated IntelliJ to community 2024.01 and brought in cursive 1.13.3-2024.1 and while some projects work fine, for some (which were working fine before I upgraded everything) I'm getting

Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main
Looking in the leningen window under my project dependencies I can see that org.clojure/clojure:1.10.1 is not listed (although other org.clojure deps are). My project.clj has this as dep [org.clojure/clojure "1.10.1"] Attempting to generate stubs or start a REPL always result in the above error. Any advice on how to troubleshoot?

imre11:04:17

Invalidate caches and restart perhaps?

Simon11:04:13

Hey, yeah, tried that but no joy.... after a couple more 👀 on it seems it might be down to projects that have global exclusions for clojure. eg in 1 project we have this in our project.clj

:exclusions [commons-logging
               log4j
               org.clojure/clojure]
Which was OK in previous versions of cursive. Removing that global exclusion seems to stop the issues (but in other projects is giving a No reader function for tag object error, not had a chance to bottom that out yet....)

Alex Miller (Clojure team)12:04:22

I believe there was a change in global exclusions in recent Leiningen so maybe it’s actually that

Simon12:04:25

:thinking_face: Thanks @U064X3EF3 - hadn't clocked that... Will see what cursive folks say!

Alex Miller (Clojure team)13:04:25

I saw someone else run into this difference (outside Cursive)

👍 1
Simon13:04:27

Certainly seems to match up... Locally I'm on lein 2.9.1 and hadn't realised IntelliJ wasn't just picking up my local version. Only offering 2.11+ in the build settings though - can work around it though!

cfleming19:04:42

I haven’t had a chance to look into this, but it seems plausible. Lein 2.11.0 (IIRC, not in front of code right now) upgraded the version of the Maven resolver that they use, and that caused some annoying internal conflicts with the resolver published by IntelliJ itself. I had to change some API use so it was just much easier to say that Cursive now required lein 2.11+. If this is a serious blocker I can revisit that decision, but would prefer not to if there’s a workaround.

Simon07:04:58

Hey @cfleming no that's fine... we'll modernise!

cfleming04:04:44

BTW is this issue you? If so I’ll close it out. https://github.com/cursive-ide/cursive/issues/2893

Simon07:04:13

Ah yes, sorry - shoulda done that myself!

Simon07:04:30

Have just closed it

cfleming07:04:50

Great, thank you!

👍 1
Joe R. Smith16:04:24

Is it possible to configure custom indentation within a macro? E.g., the defsc macro in Fulcro takes a arg vector, an options map, and then a body, where the body is the render method for the generated Fulcro component. I'd like to default to two-spaced indentation for everything in the body of that macro (it's a lot of nested divs, spans, and other react components). To clarify: even if I supply an arg on the same line as a function symbol in a list form, I want arguments on new lines to only be indented 2 spaces.

Bob B17:04:29

<https://cursive-ide.com/userguide/formatting.html> has a section that explains how macros can be configured to have some number of params followed by body, and cursive will indent the args as args and the body 'normally', and also has an option to just indent, which it seems like just indents the subsequent lines (which sounds like what you want)

gratitude-thank-you 1
👍 1