Fork me on GitHub
#cursive
<
2018-11-29
>
guillaume16:11:26

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

guillaume16:11:00

i’m having difficulty making it behave correctly on a clojure macro https://github.com/clojure/core.match indent is way off

guillaume16:11:36

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

guillaume16:11:19

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

cfleming20:11:52

@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

todo21:11:57

It is possible to do IntelliJ -> Tools -> IDE Scripting Engine -> Clojure via instaling the Clojure JSR https://intellij-support.jetbrains.com/hc/en-us/articles/115000877044-DataGrip-FAQ [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

cfleming22:11:36

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

cfleming22:11:32

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

cfleming22:11:34

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
todo22:11:55

@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

cfleming22:11:18

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

cfleming22:11:38

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

cfleming22:11:06

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

todo23:11:50

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

cfleming23:11:29

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

cfleming23:11:47

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

todo23:11:51

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

todo23:11:23

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

cfleming23:11:44

Help-&gt;Edit Custom Properties, and in the file that opens, add idea.is.internal=true.

cfleming23:11:58

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

todo23:11:29

found my cursive license key, reinstalling

cfleming23:11:42

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

cfleming23:11:02

That will open a REPL on your IDE.

todo23:11:33

interesting; thanks!