Fork me on GitHub

hello @cfleming, I am having a trouble with lein projects in IDEA14CE + cursive 0.1.71: I do: 1. lein new dude 2. launch idea 3. add dude as a new project 4. right click on project.cljs, add as lein project 5. cmd+; to open project settings 6. set project SDK to java8 7. set "src" as source folder 8 .set "test" as test folder 9. open project.clj ==> defproject symbol is recognized (not highlighted) 10. open src/dude/core.clj ==>`ns`, defn, println symbols are highlighted as unresolved.

idea 14.0.1 CE
cursive 0.1.71

$ lein -v
Leiningen 2.5.3 on Java 1.8.0_31 Java HotSpot(TM) 64-Bit Server VM

#project.cljs deps:
[[org.clojure/clojure "1.7.0"]]
Would you have any idea what the cause might be? It might have started after update to cursive 0.1.70 from 68 or 69. After that update REPL configurations stopped working on existing project, spitting out Error creating JavaParameters alert. But I cannot confirm that update is the actual cause.


Hi @misha, sorry you’re having trouble. You shouldn’t need to do most of those steps, opening the lein project after lein new whatever should add the lein project and set up src and test folders.


that was true. but now - the way I described - is the only way it sort of accepts new project as the actual clojure project


and "sort of" - is because of those unrecognized symbols in the core ns


See here: for a possible solution to the JavaParameters issue.


if I do

idea -> new project -> select project.clj
idea wraps it in a temp_project$324234 folder with the only project.clj file in it


@cfleming: I'll try cleaning up java sdk paths. but I think i;d be rather weird, if it'd fix the "new project" setup issue. thanks


@misha: No, I don’t think it’ll fix that.


Can you reproduce the issue (i.e. import a simple lein new project) and then send your log? Help-&gt;Show log in Finder/Explorer


Which OS are you on, BTW?


but I have a strong feeling, that it is a result of my whole setup getting somehow corrupted


It does sound like that, but I’m not sure what the exact problem could be - it sounds very strange.


yosemite 10.10.5 (14F27)


Feel free to DM me your log, or mail it to <mailto:[email protected]|[email protected]>, whichever is easier.


lein new colin
idea -> import project
pick colin
import from existing sources
select lein projects
==> `unable to proceed: nothing found to import`


create from existing sources
next, next
==> log


ok, if anyone is interested, the solution to the issue above I went with is: "update to IDEA 15" : )


When I turtle around the editor using the [Cntl <-] and [Cntl ->] keys I expect the 'Cntl' part of the action to be jumping the cursor past whatever bit of syntax I am at. It is usual for Clojure names to be-like-this. Just one [Cntl <-|->] ought to do the trick - ought to get me past the whole of a name-with-plenty-of-hyphens. Should I raise an issue for speedier editing?


Is there any way to specify an alternate maven repository path?


@cjmurphy: What you probably want to do is bind those keys to Structural Move Forward/Backward. That should jump over Clojure units.


@jaen: For lein, you mean?


@jaen: Cursive just invokes lein, so if you configure the repo in your project.clj it will be picked up.


I'm using boot actually. Maybe I'll explain my exact use case - basically I'm using a docker container to develop in, I mount both the code inside and the .m2 folder, so the project sees it under ~/.m2 but from outside in Cursive this will be a different directory.


So I'm wondering if there's some way to specify for Cursive to look for sources for indexing there?


Hmm, I don’t think so, no. Since Cursive just invokes lein, you’d have to be able to tell lein to do this somehow. One option would be to use :local-repo, which would cache artifacts relative to the project. A bit messy but it might work.


(while you’re using boot, I assume you’re using the hack of generating a project.clj)


Okay will do. I 'think' I remember a time when IDEA did not understand camelCase for Java variables, but these days normal Java variables are jumped over without any need for key rebinding. So I thought would be good if it worked like that out of the box for Clojure code too.


@cjmurphy: Yeah, I think the structural movement should do what you want. Try it out, and if it’s not let me know here or file an issue.


@cjmurphy: One thing that you may or may not expect is that it’ll jump over a whole list if it’s the next thing in the way.


@cfleming: yep, generated project.clj hack. So basically if I emit this attribute - - in the generated project.clj Cursive should just understand that and should look in my docker cache instead of ~/.m2, yes?


@jaen: Well, it will look in the local-m2 directory inside your project.


IDEA -> file -> Settings -> Keymap -> Clojure Keybindings


I don't see the word 'Structural' there.


@cjmurphy: Try Settings->Keymap, and then searching for Move Forward/Move Backward


@cfleming: yup, the paths appear to point to the docker cache directory now that I added this key; thanks!


Those re-bindings take over some other keys and the editor becomes a pretty big 'jumper' (for instance right across parens, from '( all the way to ')). I think this will be better however. Was annoying to have to slam so many right keys just to get past a-name, esp when coming from Java where I think variables are jumped over OOTB.


@cjmurphy: You shouldn’t have to worry about conflicts - Cursive will use its actions when editing Clojure, but the other actions will continue to work in other contexts (i.e. Java)