Fork me on GitHub
#cursive
<
2021-09-02
>
jaju04:09:56

Hi all I have a gradle project (mainly java code), in which I have some Clojure libraries as dependencies. There is no clojure build-tooling - I only have an nrepl instance through which I live-code. The problem is that cursive doesn’t seem to locate the clojure-libraries source-code, so I am unable to use normal IDE functions (like source-code navigation, refactoring etc.) The clojure library dependencies appear fine in the gradle dependencies window, and even clojure code evaluation in the nrepl works. Is there a way to hint to the Cursive editor how to integrate with the libraries already on the classpath?

cfleming08:09:07

That should just happen if the libraries are attached to your project correctly. Just to be clear, things are working for your own source in the project, correct?

jaju09:09:43

Thanks for the response and the nudge @U0567Q30W - since you say it should work, I tried a change to my dependencies to see if it affects - instead of developmentOnly I changed the clojure libraries dependencies to implementation and the problem went away. I wouldn’t have imagined that by myself as being a reason, but now that it does seem to affect, I am exploring more on how to go further. (For background: this is a springboot app and I am experimenting with introducing clojure here but keep it dev-only initially)

cfleming09:09:13

Hmm, my gradle-fu isn’t strong enough to know what might be happening there, sorry.

jaju09:09:10

Not a problem! Your input helped - I don’t mind using implementation in the mean while!

simongray08:09:09

I was curious why my deps.edn GIT repos suddenly didn’t work and experimented with reloading the project. I wanted to preserve my REPL configurations so I saved them as a file in .run. Then when I found out that I needed to upgrade to the EAP to get that functionality back, I looked for an option to re-import those REPL configurations, couldn’t find one, and then I went with some general “import settings” option in intellij. Now my whole editor has been reset. Despite syncing my intellij settings to a git repo automatically, overwriting local settings from the repo state seems to do nothing. Fucking sucks. Guess I’ll be setting up intellij and cursive from scratch this morning.

cfleming08:09:08

Sorry about that - how did you export the .run file?

simongray08:09:57

There is a checkbox in the run configurations (upper right corner) for each run configuration. Clicking that saves an XML file to /.run

cfleming08:09:40

Do you mean the “Store as project file” one?

cfleming08:09:15

That will normally store them under <project>/.idea/runConfigurations

cfleming08:09:49

Unless you have that customised? I didn’t know that was a thing, I think that must be relatively recent.

simongray08:09:12

From a (now fresh) install of Intellij

cfleming08:09:29

Yep, I see. And you still have those run config files?

simongray08:09:51

yeah, do you want me to send them to you?

cfleming08:09:57

Or are the run configs now not the problem, and it’s more that all your config is lost?

cfleming08:09:07

No, I’m just trying to figure out how to get those back.

simongray08:09:21

That all of my configuration, all of the plugins installed, everything apparently reset

cfleming08:09:32

That is very strange.

simongray08:09:14

Yup… it was very unexpected

cfleming08:09:15

Import Settings would normally accept a jar file created at some point from an export. It should (in theory) only overwrite the config that’s actually present in the jar.

simongray08:09:42

Apparently there is some undefined behaviour :S

cfleming08:09:16

That said, there’s plenty about IntelliJ I still don’t understand, but that definitely does not sound like expected behaviour.

simongray08:09:40

Anyway, thanks for getting back to me. I’m using Cursive free of charge at the moment, so I shouldn’t be complaining.

cfleming08:09:27

So normally, when you tick that option, the files are stored within .idea, and the IDE should pick them up. However, I don’t know how that works when that location has been customised. In the new copy of your project, if you customise that location then close the project and reopen it, does it find them?

cfleming08:09:35

Free users deserve support too 🙂

🙏 6
simongray08:09:57

I did convert a bunch of people at my old workplace from poor emacs setups to Cursive which resulted in additional licence purchases :P

cfleming08:09:32

We need some sort of preacher or messiah emoji.

💯 2
simongray08:09:11

> So normally, when you tick that option, the files are stored within `.idea`, and the IDE should pick them up. However, I don’t know how that works when that location has been customised. In the new copy of your project, if you customise that location then close the project and reopen it, does it find them? Right now the issue is that all of my intellj settings were nuked, keybindings, plugins, everything, so I really can’t check this stuff at the moment

simongray08:09:46

not just the project specific settings. I makes little sense to me why this would happen.

simongray08:09:27

No recent projects either… everything is gone

cfleming08:09:36

That is really weird, I’ve never heard of anything like that. Unfortunately, I think you’re right that reinstalling is your only option. Once your IDE is moderately sane and you have your project back, with a bit of luck IntelliJ will pick the run configs back up.

simongray08:09:20

Ok, reinstalled Cursive EAP, managed to restore my keybindings (I think), so the damage was controllable

simongray08:09:48

but I’ll manually restore the REPL run configurations this time, not risking anything

cfleming08:09:03

Nice, I’m glad to hear it!

thumbnail17:09:09

I encountered this while refactoring some code; the second cursor is typing in reverse 🤯

🙃 8
thumbnail17:09:49

Currently on 1.10.2-2021.1 btw

Jeff Evans19:09:49

Just noticed that my license expired, and it got me thinking back to when I first purchased the Cursive license a year ago. I was going through a rough time, professionally and personally. Probably strange to say, but using Cursive felt like the one thing that was just “working” at the time, even though I ran into occasional (literal) bugs and glitches. I was already extremely comfortable with IntelliJ, so it allowed me to learn Clojure with a minimal amount of extra cognitive overhead. Now, I have a terrific full time job writing Clojure (in Cursive, obviously). It’s a fantastic tool, and the fact that the developer is here in Slack answering questions is an almost ridiculous bonus. Keep up the great work (and take my money for the renewal).

☝️ 6
💯 18
4
2
clojure-spin 2
cfleming21:09:22

Thanks for the kind words, Jeff! I enjoy developing tooling because I like helping make people’s work more pleasant, it’s always great to hear that that’s the case.

JAtkins22:09:54

I’m having trouble with project resolution at the moment. Something about 401 unauthorized error. I can’t replicate this in the cli, so I was wondering if and where log files would be stored for that?

JAtkins22:09:59

Ah, found the problem. Would be useful to have logging to help trace stuff like this down still though.

cfleming22:09:41

What was the problem, out of curiosity?

JAtkins22:09:56

I’m setting up a new laptop and downloaded dev-local deps. Turns out I downloaded a newer version, so the version my repo wanted wasn’t in my mvn folder. Not exactly sure how that causes a 401, but :man-shrugging: .

cfleming22:09:32

What’s weird is that it worked on the CLI - is that correct?

JAtkins22:09:12

It’s slightly more complicated. I made an :override-deps alias in my global deps, and was using it on the cli without selecting it in the cursive aliases. Should’ve caught it.

cfleming22:09:45

Ah, ok, that makes sense. What sort of logging would have helped, do you think?

JAtkins22:09:34

If I run the cli with the wrong dev-local dep intentionally, it says the error is “failed to read artifact descriptor for com.diatomic:dev-local ....”. Along with the mvn stack trace. Would be nice to be able to see that in the logs.

JAtkins22:09:18

The IJ / Cursive log for the error only prints the reason phrase “Unauthorized (401)”

cfleming22:09:26

Ok, I’ll repro that and see what I can do, thanks.

👍 2
JAtkins22:09:27

*event log

cfleming22:09:10

If there’s anything in the log, it’ll be in the file at Help -&gt; Show log in Finder/Explorer, but it would be nice to surface that in the IDE too.