cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
2020-11-27T12:15:54.119600Z

is there any way to make sure that if by mistake I print out a massive amount of text in the repl, I can still kill the repl without having to kill Emacs entirely

2020-11-27T12:15:59.119800Z

or just kill whatever is printing out?

2020-11-27T12:16:24.120500Z

I added the auto trimming but it doesn't really help as much sadly

practicalli-john 2020-11-27T12:42:53.123500Z

@andrea.crotti cider-interrupt if output is from the last evaluation of an expression. Or sesman-quit should kill the repl. Or kill the buffer and it should kill the repl (unless your code is hanging onto resources and wont shut down. I dont think there are any guarantees with any software...

bozhidar 2020-11-28T10:14:53.134600Z

The output is being streamed in chunks, that's why even if Emacs rejects printing something over some limit only interrupt can potentially stop the generation of more output. That's also why we went with auto-trimming instead of putting some hard limit for the output - as new chunks get streamed the older should get deleted. Unfortunately, if something outputs an extremely long line this might mess up Emacs quite a lot.

bozhidar 2020-11-28T10:15:07.134800Z

I still don't have any better solutions in mind than what we currently have.

2020-11-27T12:43:41.123600Z

yeah I know but sometimes it takes minutes to even be able to run these two commands

2020-11-27T12:43:57.123800Z

the whole Emacs get locked and you can't really do much

2020-11-27T12:44:12.124Z

I can kill the JVM process from the outside which sometimes helps but it's not great

2020-11-27T12:45:02.124200Z

maybe cider could just have a limit to the size of the string it prints out by default?

2020-11-27T12:45:13.124400Z

since if it's bigger than a given threshold it's very likely to just be a mistake

practicalli-john 2020-11-27T16:23:16.124600Z

This may only work in some cases, but if you have the cider-inspect window open, then evaluation results should all go there by default. I don't think this helps if something is forcing errors into the repl, like 3rd party Java or Scala libraries. If something is logging, it should be going to an external logging service

2020-11-27T20:00:46.126800Z

Why is it that I only get an nrepl and not the usual cider-repl if I set cider-clojure-cli-global-options to "-M:dev", which in turn uses

:dev     {:extra-deps {;; Tracing, debugging etc.
                         com.bhauman/figwheel-main       {:mvn/version "0.2.12"}
                         org.clojars.stumitchell/clairvoyant {:mvn/version "0.2.1"}
                         day8.re-frame/re-frame-10x      {:mvn/version "0.7.0"}
                         day8.re-frame/tracing           {:mvn/version "0.5.1"}}
            :main-opts  ["-m" "figwheel.main" "-b" "dev" "-r"]}
I think maybe, I’ve bumped into this issue before, but I don’t remember the solution

dpsutton 2020-11-27T20:02:28.128500Z

I’m not sure what you mean by an nrepl but you’re not starting the nrepl command line as required. Nrepl needs its own main to start an nrepl server. You’re specifying figwheel main to do it’s own startup

2020-11-27T20:11:17.131Z

if I leave cider-clojure-cli-global-options at nil, move the figwheel-main dep into my top-level deps and jack in, it works just fine with the REPL, but then I don’t have re-frame-10x etc

2020-11-27T20:15:15.132500Z

[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {nrepl {:mvn/version "0.8.3"} cider/piggieback {:mvn/version "0.5.2"} cider/cider-nrepl {:mvn/version "0.25.4"}}}' -M:dev -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware","cider.piggieback/wrap-cljs-repl"]
This is done even though I set cli-global-options, but a REPL buffer is not connected to it

2020-11-27T20:15:29.132800Z

everything works in the browser as it should though

dpsutton 2020-11-27T20:22:21.134Z

Not sure how to setup the 10x stuff. I think there are some preloads to register or something like that? The documentation shows how to do it I think

2020-11-27T20:26:53.134300Z

Yeah.. That works with cider-clojure-cli-global-options set