Fork me on GitHub
#cursive
<
2017-08-08
>
cjmurphy09:08:09

I just discovered 'Tools / REPL / Jump to REPL editor'. Can this command have a keybinding? I have tried to give it one by going to 'File / Settings / Keymap / Clojure keybindings'. When there I found that 'Jump to REPL editor' existed, but unfortunately didn't seem to be selectable/editable. And is there a standard keybinding for this command? (I'm going to use F12 is there is no standard).

cfleming09:08:10

@jeremys Yes, in your REPL run configuration you can specify the profiles it should use to build the classpath.

cfleming09:08:54

@cjmurphy Yes, you should be able to bind that, but for changing individual bindings you want File-&gt;Settings-&gt;Keymap. You can search for it there and assign it a key.

cfleming09:08:08

I don’t think there’s a standard binding, no.

jeremys12:08:38

Hey @cfleming that’s the thing, figwheel’s wiki recommands the use of the third repl option “use clojure.main in normal jvm process”. When I use this repl the profiles selection textfield is disabled... https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL

Garrett Hopper13:08:34

Has anyone else had trouble with Intellij/Cursive reformatting cljc conditionals incorrectly?

jffry17:08:38

Yeah, I've definitely run into this as well. Only happens sometimes for me, haven't had enough time to tinker yet to narrow down when it's wrong

Garrett Hopper17:08:35

Hmm, ok. It seems very random about when it breaks.

Garrett Hopper17:08:28

It seems to be strongly dependent on the positioning of the conditional.

cfleming20:08:41

@U5JUDH2UE If you have example cases, I’d appreciate an issue with them.

cfleming20:08:51

There’s one about the ns form out there, one sec…

Garrett Hopper17:08:34

That's actually exactly the issue I'm running into. Thanks!

misha17:08:55

I have a bunch of expanded keywords in a file. Is there a way to replace those with short alias? Or am I overthinking it, and find/replace would work just fine?

zylox17:08:20

seems like something easy to test

Garrett Hopper17:08:28

It seems to be strongly dependent on the positioning of the conditional.

Joe R. Smith18:08:46

Is it possible to get Parinfer w/ Cursive to re-indent subsequent forms when adding new forms before them? i.e., If I have a form that contains another form (e.g., a map) that is on multiple lines and I add a form before the map it’d be nice if it re-indented the map entries on subsequent lines, preferably while I type.

jjfine18:08:03

if it did that, how would you input a form that didn't contain that map?

Joe R. Smith19:08:50

@jjfine the idea is not changing the structure of subsequent forms when adding a new form in front of it

Joe R. Smith19:08:05

e.g.:

(myfunc {:a 2 
         :b 3})
now if I add a symbol in front of that map, parinfer will do this:
(myfunc blah {:a 2}
        :b 3)

jjfine19:08:26

Oh yeah that would be nice

Joe R. Smith19:08:37

yeah, hard to explain in words

cfleming20:08:18

@solussd @jjfine That’s actually handled by Parinfer v3's new smart mode, which we’re working on right now - I’m hoping to integrate that for testing this week.

Joe R. Smith20:08:40

@cfleming awesome! I can’t wait to try it.

cfleming20:08:16

@jeremys Oh right, sorry - there’s actually an issue out there to allow running that REPL via lein to allow profile selection.

cfleming20:08:10

Feedback very welcome

Joe R. Smith20:08:40

yes, that is exactly what I want.

jeremys20:08:35

@cfleming ok cool I’ll track down the issue

cfleming20:08:34

@jeremys When running the clojure.main REPL, it uses the classpath of your project as seen by IntelliJ. You can control how that is created by setting the profiles Cursive uses to create that.

jeremys20:08:06

Oh really!

cfleming20:08:10

That’s in the Leiningen toolwindow - View-&gt;Tool Windows-&gt;Leiningen

cfleming20:08:02

There’s a profiles entry where you can select the profiles it should sync to the classpath. Adjust those, and then hit refresh (I can’t recall if that’s required or not, I think so)

jeremys20:08:53

oh nice It was under my nose... Thx Colin.

yedi20:08:27

I'm having the most annoying issue

yedi20:08:43

randomly cursive will stop formatting my CLJS code like it normally does

cfleming20:08:02

@yedi Can you send a screenshot?

yedi21:08:05

(defn [args]
  nil)
will start indenting as
(defn [args]
      nil)

yedi21:08:23

maybe formatting was the wrong word, but the indentation behavior will rbeak

yedi21:08:30

to fix it id have to invalidate cache and restart

yedi21:08:34

but it happens pretty often now

cfleming21:08:46

That’s probably a problem with your indexes - oh, ok, you’ve tried that 🙂

yedi21:08:05

i can't figure out whats causing it to get in that state

cfleming21:08:14

Is everything resolving ok, or are you seeing a sea of yellow?

yedi21:08:39

yea im getting fn cannot be resolved

cfleming21:08:57

Ok, that’s the problem

cfleming21:08:25

Is your file under a source root? Blue folder in the project view?

yedi21:08:57

the src folder is blue

yedi21:08:03

and the files is nested deeply within

cfleming21:08:55

Do you have ClojureScript as a dependency of the module? File-&gt;Project Structure-&gt;[your module]-&gt;Dependencies

yedi21:08:34

ah apparently not

yedi21:08:48

how do i add it

cfleming21:08:04

How did you create the project? With lein?

cfleming21:08:15

And you have CLJS in your :dependencies?

yedi21:08:57

[org.clojure/clojurescript "1.9.671" :scope "provided"]

yedi21:08:11

not sure what :scope "provided" does tho

cfleming21:08:14

That’ll give it to you in the editor but not in any artifacts you create - unless you have a good reason for it being there, I don’t think you need it, but obviously I don’t know your project.

cfleming21:08:21

Does refreshing your project (View-&gt;Tool Windows-&gt;Leiningen-&gt;[refresh button]) fix the problem?

yedi21:08:28

it also says there are no lein projects to display

cfleming21:08:43

That’s the issue - weird.

cfleming21:08:59

In your project view, right click your project.clj and Add as Lein project

yedi21:08:00

ah k, that appears to have fixed it

cfleming21:08:20

You’re supposed to get a warning when that happens, I’ll check that’s working.

yedi21:08:35

thanks so much for all the help

cfleming21:08:47

No problem! Sorry for the hassle.