Fork me on GitHub
#cursive
<
2019-05-30
>
cfleming01:05:52

@simon.orlovsky Can you send a screenshot of the REPL configuration?

simon16:05:19

@cfleming here is my configuration

cfleming22:05:22

@simon.orlovsky So the problem is the error message at the bottom, saying that Cursive can’t find clojure.main, which generally means that Clojure isn’t attached to your project.

cfleming22:05:59

How did you set this project up? Looks like you’re using Leiningen, right? What does your leiningen toolwindow look like?

simon22:05:03

@cfleming yes I am using leiningen. Doesn’t seem to be much going on in this tab

cfleming22:05:41

Ok, so what you want to do is find your project.clj in the Project View, right click on it and select “Add as leiningen project”

simon20:06:19

For some reason I am not getting that option

simon20:06:56

I tried adding project.clj with + sign here as well but that didn’t work

simon22:06:29

I have one project that still works. It has this in the project structure

simon22:06:22

for new projects libraries don’t have any dependencies in there

cfleming22:06:04

@simon.orlovsky how are you creating these projects?

simon22:06:16

lein new testapp

cfleming22:06:44

Ok, but how are you importing them into Cursive?

simon22:06:12

I do file->`open`

simon22:06:19

then I get the x

cfleming22:06:21

So if you do lein new testapp, then File | Open…, then select the project.clj in the new project, it doesn’t get created correctly?

cfleming22:06:41

Could you try that on a new project, then let me know so we can try to figure out what’s going on?

simon22:06:21

yes it doesn’t set up correctly — I get Run Configuration Error: No modules containing clojure.main found

simon22:06:32

when I try to set up the project

cfleming22:06:25

Well, that’s when creating the run config, right? But before that, after File | Open Cursive does create a project? What does the Leiningen toolwindow look like for that new project?

simon22:06:33

doesn’t seem to have any profiles

simon22:06:36

maven is also empty

cfleming22:06:48

That’s really weird.

cfleming22:06:12

Well, it won’t use Maven, just Leiningen. Can you send me your log? Help | Show log in Finder

simon22:06:24

Sent as DM

mhuebert13:05:07

I found this old/closed issue about excluding cljs-out, https://github.com/cursive-ide/cursive/issues/2080 I was wondering if there is any general way to always exclude folders matching a certain pattern? I’m finding that certain directories are continually re-added to the index, probably after I’ve made changes to my deps.edn, so I end up repeatedly hunting for the same directories to exclude. in my case they all have names like public/compiled, cljs-runtime, out, .shadow-cljs, etc

devn17:05:44

How do I stop automatic alignment of maps and such?

devn17:05:20

I want:

{:a 1
 :bcd 2}
not
{:a   1
 :bcd 2}

manutter5117:05:41

Preferences -> Editor -> Code Style -> Clojure -- General tab -- “Align let-binding values”

devn17:05:11

thank ya

cfleming22:05:30

@manutter51 @devn Actually there are two separate settings there, “Align let-binding values” and “Align map values” - obviously you want the map one for that case.

devn22:05:10

@cfleming yes, saw that, thank you. also, please register my vote for leaving those off as a default. they create messy merges and diffs.

cfleming22:05:41

@devn Ok, noted, thanks - I think the binding forms are off by default but the maps are on.

manutter5123:05:59

Oops, I copy-pasted from the very similar question yesterday or the day before, should have paid closer attention.

cfleming23:05:12

@mhuebert There isn’t right now, but I’ll look at that. What used to happen using Leiningen is that the lein integration would add excluded directories but never remove them, so if they had been configured manually they would remain excluded.

cfleming23:05:25

To my eternal regret I used an IntelliJ framework for deps rather than just replicating what I did for lein, and now I have less control over things like that. I think that that may be why this no longer works under deps.

unbalanced10:06:55

for what it's worth, deps is working on great for me

cfleming21:06:44

@U3BALC2HH Thanks for letting me know! It mostly works ok and does save a lot of work at first, but internally it’s not too flexible.

cfleming23:05:29

Also, in Lein generally e.g. cljsbuild is configured in project.clj so Cursive can work out the directories to exclude, but with deps that’s not always the case, and not in any standard format that Cursive could extract.