cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
Sam Ritchie 2021-05-20T14:36:46.002500Z

Emacs keyboard macro!

dpsutton 2021-05-20T14:41:12.003200Z

clojure-lsp can do this as well as clj-refactor. My coworker wrote a lein plugin that will check and print a correct one in <https://github.com/camsaul/lein-check-namespace-decls>

ghadi 2021-05-20T20:00:41.003800Z

I'm having a weird issue where I type in a simple expression like :foo and the spinner at the bottom of the screen takes forever

ghadi 2021-05-20T20:01:47.004600Z

I am using latest CIDER 1.1.0.1, on homebrew installed emacs-plus@27

ghadi 2021-05-20T20:02:45.005100Z

Does anyone know how to troubleshoot that?

dpsutton 2021-05-20T20:08:03.005900Z

m-x nrepl-toggle-message-logging and watch the nrepl traffic. In theory that just spins while waiting on the done handler for the id of the form you evaluated. So watching the traffic could help shed some light

dpsutton 2021-05-20T20:09:36.006200Z

the code to stop spinning is simply

(defun cider-eval-spinner-handler (eval-buffer original-callback)
  "Return a response handler to stop the spinner and call ORIGINAL-CALLBACK.
EVAL-BUFFER is the buffer where the spinner was started."
  (lambda (response)
    ;; buffer still exists and
    ;; we've got status "done" from nrepl
    ;; stop the spinner
    (when (and (buffer-live-p eval-buffer)
               (let ((status (nrepl-dict-get response "status")))
                 (or (member "done" status)
                     (member "eval-error" status)
                     (member "error" status))))
      (with-current-buffer eval-buffer
        (when spinner-current (spinner-stop))))
    (funcall original-callback response)))

ghadi 2021-05-20T20:16:40.006600Z

thanks. I will try that @dpsutton.

ghadi 2021-05-20T20:16:55.007Z

It happen most often when I am screensharing with someone 🙂

ghadi 2021-05-20T20:17:00.007200Z

(but not exclusively)

dpsutton 2021-05-20T20:20:44.007500Z

(i'm surprised to see you using nrepl)

ghadi 2021-05-20T20:34:43.007800Z

old habits die hard