Fork me on GitHub
#cursive
<
2018-09-26
>
dazld10:09:02

i kind of wish that the shortcut to go to the repl would toggle between repl and last window

witek13:09:02

Hi. I am trying Cursive for a ClojureScript project with deps.edn. After crating and adding pom.xml with clojure -Spom most of the "... cannot be resolved" messages are gone. But I still have many. This one for example: (.-head js/document) causes ".-head cannot be resolved". And (.log js/console "hello world") causes ".log cannot be resolved". How to deal with this?

rarous18:09:32

Cursive does not have recognition for JS modules especially for global and browser APIs

rarous18:09:46

It would need to require IDEA WebDevelopment plugins (not included in community edition) or implement it from scratch (probably time expensive)

scarytom14:09:29

When importing a leiningen project into intellij using cursive, I notice that all the project dependencies have a scope of "Compile". I would expect test dependencies to have a scope of "Test". Is there any way to fix this?

cfleming17:09:54

@dazld I did consider that - the problem then is that you have to think about where you are currently to know what the command is going to do.

dazld08:09:49

it’s like the quake console, toggle in, toggle out. I guess the context is usually pretty clear.

dazld08:09:04

I do miss this, and it gets in the way for me every day

dazld08:09:13

maybe an option to make it behave this way could be a solution..

dazld08:09:19

or another keymap

cfleming17:09:35

@witek Yes, JS interop is currently very noisy because it’s almost impossible to do correctly - I’m going to fix that soon.

shaun-mahood20:09:31

@cfleming I'm trying to get the new EAP to start a REPL with a deps.edn based project - have you got anything written or could you point me in which direction I should be trying now? There are a bunch of new options and I'm not sure which one I should be trying to get work (Local REPL with Deps is the direction I'm leaning but getting an error "No modules containing clojure.main found")

cfleming20:09:17

@shaun-mahood That error normally means that you don’t have Clojure attached to any modules as a dependency.

cfleming20:09:48

As to the options you might want, there are two axes now - the type of REPL and how you want to run it. The type of REPL is basically a choice between nREPL (RPC style) and clojure.main (streaming style). Currently Cursive support is better for nREPL so I’d choose that unless you have a good reason not to.

cfleming20:09:38

For execution, I’d use Deps for Deps projects, since that will allow you to use aliases etc when running.

shaun-mahood20:09:38

Ok, how would I translate clojure -m figwheel.main into the format it's expecting? Nothing I've tried seems to work (screenshot in thread)

shaun-mahood20:09:34

Not sure if this pasted correctly or not, I got a message from slack and not sure if you can see it or not

cfleming20:09:55

Yeah, Slack moans but then shows the image anyway.

shaun-mahood21:09:03

Oh good - wasn't sure if it showed it to anyone else 🙂

cfleming21:09:07

@shaun-mahood There’s an issue with the clojure.main REPL type which means that you can’t specify figwheel.main as the main class. I’m planning to fix that for the next EAP.

shaun-mahood21:09:53

Oh that makes me feel better about things 🙂 I guess I'll leave the rest of this until then and just work on the leiningen docs

cfleming21:09:03

Ok - one thing to beware of is that all those options have changed, as you noticed. I’m hoping to get a stable build of this EAP out sometime soon, but I’m travelling so times are a little unpredictable right now.

cfleming21:09:12

I’m also planning to document all this myself soon as well - perhaps I could combine what you have into the Cursive docs? Or at least if you have notes about what’s worked well from you I can document from there from a Cursive POV and Bruce can use it from a Figwheel POV?

shaun-mahood21:09:21

Yeah, I'll probably focus on the stable build for now and update when the new build comes out - my real project is still using lein so I'm not in any hurry.

shaun-mahood21:09:31

My immediate plan is to document the "simple" way to use lein from a new project with just CLJS, the way I've got it running for me with CLJ and CLJS, and then another bit with the full build (CLJ, CLJS, Integrant, Uberjar, and SSL) for both dev and production. I'll send you a link to the figwheel specific docs as I get them done, but would be happy to adapt into a more Cursive centric form or you can just steal what you want.

cfleming21:09:28

Ok, that sounds good. I’ll be interested to see that as well since I don’t use CLJS myself.

shaun-mahood21:09:14

Do I need to worry about the Intellij version for anything, or just the Cursive version?

cfleming21:09:23

Just the Cursive version.