Fork me on GitHub
#cursive
<
2015-11-30
>
misha00:11:21

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.

cfleming00:11:48

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.

misha00:11:35

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

misha00:11:01

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

cfleming00:11:25

See here: https://cursiveclojure.com/archive/1567.html#1615 for a possible solution to the JavaParameters issue.

misha00:11:36

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

misha00:11:22

@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

cfleming00:11:37

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

cfleming00:11:38

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

cfleming00:11:46

Which OS are you on, BTW?

misha00:11:54

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

cfleming00:11:25

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

misha00:11:32

yosemite 10.10.5 (14F27)

cfleming00:11:47

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

misha00:11:13

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

misha00:11:02

back
create from existing sources
next, next
==> log

misha01:11:31

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

cjmurphy06:11:05

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?

jaen14:11:59

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

cfleming20:11:42

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

cfleming20:11:57

@jaen: For lein, you mean?

cfleming20:11:36

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

jaen20:11:58

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.

jaen20:11:17

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

cfleming20:11:59

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.

cfleming20:11:23

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

cjmurphy20:11:35

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.

cfleming20:11:17

@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.

cfleming20:11:08

@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.

jaen20:11:04

@cfleming: yep, generated project.clj hack. So basically if I emit this attribute - https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L119 - in the generated project.clj Cursive should just understand that and should look in my docker cache instead of ~/.m2, yes?

cfleming20:11:46

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

cjmurphy20:11:13

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

cjmurphy20:11:28

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

cfleming20:11:34

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

jaen20:11:30

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

cjmurphy20:11:50

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.

cfleming20:11:56

@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)