Fork me on GitHub

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

☝️ 4

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?


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


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


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?


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


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


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


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


or another keymap


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


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


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


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.


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


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)


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


Yeah, Slack moans but then shows the image anyway.


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


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


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


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.


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?


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.


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.


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


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


Just the Cursive version.