Fork me on GitHub
#cider
<
2018-04-11
>
r0man09:04:13

Hello, I just upgraded to cider 0.17.0 and noticed that the cider-cljs-lein-repl variable is deprecated/obsolete now. I used this variable to start a custom ClojureScript REPL. It looks like I can't customize this anymore and the only options I have to start a ClojureScript REPL are the ones defined in cider-cljs-repl-types. Could we restore the previous behaviour and add something like a "Custom" ClojureScript REPL type to cider-cljs-repl-types and make this type of REPL configurable with a variable like cider-custom-cljs-init-form again?

mitchelkuijpers09:04:53

@r0man you can add your own commands by:

(add-to-list 'cider-cljs-repl-types '("Shadow CLJS" "(do (shadow.cljs.devtools.server/start!) (shadow.cljs.devtools.api/watch :app) (shadow.cljs.devtools.api/nrepl-select :app))" nil))

mitchelkuijpers09:04:17

Which is actually pretty awesome you can create as many options as you like

r0man09:04:58

@mitchelkuijpers yes I thought about this. But wasn't sure how to do this with .dir-locals.el. I was using a .dir-locals.el file checked into my project and I could just jack-in.

r0man09:04:21

do you know if I can I somehow add to a list with dir-locals.el?

mitchelkuijpers09:04:37

Yes that is exactly what I have hold on

mitchelkuijpers09:04:52

((nil . ((projectile-project-type . lein-test)
         (eval . (progn
                   (require 'cider)
                   (add-to-list 'cider-cljs-repl-types '("Shadow CLJS" "(do (shadow.cljs.devtools.server/start!) (shadow.cljs.devtools.api/watch :app) (shadow.cljs.devtools.api/nrepl-select :app))" nil))
                   (setq projectile-create-missing-test-files t))))))

r0man09:04:07

ah, cool, good old eval 🙂

mitchelkuijpers09:04:43

No problem at all I got this from @bozhidar

r0man09:04:01

@mitchelkuijpers this works perfectly. thanks again! 🙂

r0man10:04:29

oh, and the new diff in failing tests is also very nice. thanks for adding this!

bozhidar12:04:25

@bhauman Can you please run the profiler for a bit while experiencing the slowdown?

bozhidar12:04:38

Once we know what exactly is off we can easily fix it.

bhauman13:04:16

@bozhidar which profiler is there one in emacs?

bozhidar13:04:50

The build in one. You just start it, work for a bit and stop it.

bozhidar13:04:59

It generates a very useful and simple report.

bhauman15:04:02

@bozhidar where should I send the report?

bhauman15:04:50

looks like clojure-project-dir got called more than 200 times in less than 40 keystrokes via cider--anchored-search-suppressed-forms

bhauman15:04:42

which was being called during fontlock runs

ajs15:04:09

The suspense is quite engaging on this one.

bozhidar16:04:34

@bhauman Just file a ticket and attach the report to it.

bhauman16:04:49

you got it, thanks

bozhidar16:04:39

But it seems that your hunch is correct and this has something to do with the font-locking of reader conditionals.

richiardiandrea20:04:23

today I got to use cider again after inf-clojure land and woa, so many goodies 😄

richiardiandrea20:04:59

wondering if socket REPL is in the TODO list by someone already

arrdem20:04:34

it exists in the sufficiently large todo lists 😉

bozhidar20:04:05

Now that orchard exists the only really big chunk of work is to sit down and write the low-level connection handling. After that’s done we’ll just add some connection-type dispatch for all commands and slowly start adding socket versions of the nREPL commands. At least this is how I’m envisioning the process.

bozhidar20:04:56

It won’t happen overnight, but it’s not rocket science either - just a bit of boring extraction/abstraction cycles. 🙂

bozhidar20:04:44

@nha Just set cider-font-lock-reader-conditionals to nil.

bozhidar20:04:09

(I assume this is going to solve @bhauman’s problem as well, at least as a workaround)

richiardiandrea21:04:52

Sounds like a good plan, actually probably less code then actually adding hooks and custom functions to my own inf-clojure.el conf file. The other interesting piece I have run against is how to detect that the socket repl (or any connection for that matter) has loaded/done the correct init stuff. In particular socket repls accept functions can do all sorts of stuff and I wonder if cider could generate them

bozhidar21:04:42

Likely we’ll just add those to orchard and inject it when starting a socket REPL. You’ll still need the supporting functionality anyways, so I don’t imagine how you can achieve anything more than basic evals without throwing in some tooling library in the mix.

bhauman23:04:15

whoa orchard is really good to know about

bhauman23:04:23

for rebel-readline

arrdem23:04:48

Slightly off topic - has anyone played with running lein sorta as a server?

theeternalpulse23:04:39

like running lein and connecting with cider-connect?