Fork me on GitHub

Is there a way to have cursive respect the formatting rules of cljfmt?


i’m having difficulty making it behave correctly on a clojure macro indent is way off


ok i managed to make it behave correctly by doing alt+enter on match, then enter, then select indent


but it would still be useful to hook on cljfmt rules instead of duplicating the logic across editor configs


@guillaume.carbonneau There isn’t anything like that at the moment, no, but it’s something that a few people have asked about.

Ben Hammond21:11:22

I have a deps project, and i'm trying to hook up to a figwheel clojurescript REPL to it

Ben Hammond21:11:26

and wondering how I can stick --middleware "[cider.piggieback/wrap-cljs-repl]" into the nrepl spawned by cursive

Ben Hammond21:11:45

naive (cljs-repl) tells me

ExceptionInfo Failed to launch Figwheel CLJS REPL: nREPL connection found but unable to load piggieback.
This is commonly caused by
 A) not providing piggieback as a dependency and/or
 B) not adding piggieback middleware into your nrepl middleware chain.
Please see the documentation for piggieback here 

Note: Cider will inject this config into your project.clj.
This can cause confusion when your are not using Cider.  clojure.core/ex-info (core.clj:4739)

Ben Hammond21:11:12

is there a recommended way to do this?

Ben Hammond21:11:59

I do have piggieback in my classpath

Ben Hammond21:11:19

its how to wrap the nrepl middleware when its a cursive nrepl

Ben Hammond22:11:25

switching over to clojure.main REPL seems to do the trick

Ben Hammond21:11:12

that I don't understand


It is possible to do IntelliJ -> Tools -> IDE Scripting Engine -> Clojure via instaling the Clojure JSR [I have this working] Are there any plans to make it as easy to extend IntelliJ via Clojure as it is to extend Emacs via Elisp ?

Ben Hammond22:11:25

switching over to clojure.main REPL seems to do the trick


@ben.hammond Yes, there’s no good way right now to install middleware into the Cursive nREPL stack for that first REPL option.


@todo It’s possible to some extent, but I haven’t investigated in much. It’s fairly poorly documented, and you can’t extend everything about IntelliJ that way like you can with emacs.

Ben Hammond22:11:37

Is it anywhere on your roadmap?


Yes, the next major thing on my roadmap is making CLJS REPLs easier, hopefully as close as possible to how easy they are for Clojure

👍 4

@cfleming: agreed on the lack of documenation part -- I've been grepping through the IntelliJ community edition source to figure out how to do things What do you mean by you can't extend everything? In my limited understanding, anything you can do via a "real" Java/Kotlin plugin, you can do at the IDE Scripting Console


@todo So some things can’t be created dynamically, I believe. Indexes would be one example, if you need a new index you pretty much have to write a plugin. You can install extensions for most extension points at runtime, but it can get pretty funky.


BTW if you’re using Cursive you can get a REPL on your open IDE instance if you want.


Which is why I’ve never investigated the console much.


@cfleming: I purchased a Cursive license a while back, but have not used it much since I shortly switchec to Kotlin aftertwards. What do you mean by "get a REPL on your OpeN IDE instance" ? Does Cursive alfready offer the full power of "ide scripting console"


@todo Yes, I think so - it’s somewhat hidden since it’s mostly there for my use.


Also, if you’re just playing around with this then you can use a (free) non-commercial licence.


I might reinstall cursive just for this. How do I fire it up


I really did purchase a license a while back, I'm not sure if it was 1 year or if it was perpeutual though


Help-&gt;Edit Custom Properties, and in the file that opens, add


All Cursive licences are perpetual, but you’ll only get updates for a year.


found my cursive license key, reinstalling


Once you’ve done that, restart and you’ll have a new menu item: Tools-&gt;Start IDE console


That will open a REPL on your IDE.


interesting; thanks!