Fork me on GitHub
#calva
<
2022-12-17
>
robertfw09:12:43

If someone, it could be anyone, were to hypothetically evaluate a loop that was bugged and thus didn't exit, and that loop had a println expression in it that was now spitting hundreds of thousands of lines of the number 10 into their calva output.... hypothetically, how does one get this to stop without resorting to a full restart of vscode? (I tried "interrupt running evaluations" and when that didn't work, disconnected from the REPL server, but the insistent cry of my debug statement of 10! kept on flowing until I restarted vs code)

orestis11:12:05

I think what you were seeing were buffered statements. With a bit of patience they might have stopped but how much is “a bit” I don’t know.

orestis11:12:35

Restarting vs code and the actual REPL is the safest option.

orestis11:12:24

This kind of thing leads me to sometimes add counters in my loops to make them self destruct after say 100 iterations.

pez11:12:28

Should be enough to reload the VS Code window.

skylize13:12:24

I find that for, some reason, this situation sometimes requires repeated interrupts. Use the hotkey, so you can just tap it over and over until the repl gives up.

robertfw20:12:17

Thanks all. I agree they are likely buffered outputs. I'll give reload window a try next time, I forgot about that option.

pbranes14:12:32

I am trying to Jack-in to my new deps.edn clojure project.  It looks like it is started but I cannot evaluate any expression in my .clj file? I can fire up the project and see a web page from the code but would like to start doing some coding from the repl.  I will post my deps.edn below... I didn't think I had to add an alias for the repl-server? 

{:paths ["src/clj" "resources"]
 :deps {org.clojure/clojure {:mvn/version "1.11.1"}
        metosin/reitit {:mvn/version  "0.5.18"}
        http-kit/http-kit {:mvn/version "2.6.0"}}
 :aliases
 {:run {:main-opts ["-m" "pbranes.cron.core"]}
  :repl-server
  {:exec-fn clojure.core.server/start-server
   :exec-args {:name "repl-server"
               :port 5555
               :accept clojure.core.server/repl
               :server-daemon false}}}
 }

pez14:12:27

Can you describe the steps you take to jack in?

pbranes15:12:46

1. Selected "Jack-In" action 2. Chose "deps.edn" 3. Then "run" alias 4. java -jar ".calva\deps.clj.jar" -Sdeps "{:deps {nrepl/nrepl {:mvn/version,""1.0.0""},cider/cider-nrepl {:mvn/version,""0.28.5""}}}" -M:run:repl-server 5. "server started"

pez15:12:21

Calva should warn you about the :run alias, because it has a main option overriding Calva's jack-in main option. Try it without selecting any alias.

👍 1
pbranes15:12:39

That worked. Thank you! I did get the message but probably didn't read it carefully enough.

metal 1