Fork me on GitHub
#inf-clojure
<
2021-03-31
>
dpsutton15:03:21

shadow runs a helpful little socket repl. you can easily use that with the following:

(defun personal/shadow-repl ()
  (interactive)
  (let* ((proj-dir (clojure-project-dir))
         (shadow-file (expand-file-name "socket-repl.port"
                                        (file-name-as-directory
                                         (concat (file-name-as-directory proj-dir) ".shadow-cljs"))))
         (shadow-port (when (file-exists-p shadow-file)
                        (with-temp-buffer
                          (insert-file-contents shadow-file)
                          (buffer-substring-no-properties (point-min) (point-max))))))
    (if shadow-port
        (let ((inf-clojure-custom-repl-type 'cljs))
          (inf-clojure-connect "localhost" shadow-port))
      (message "No shadow socket repl info found"))))
and then (shadow/node-repl) and off you go. there's a function (help) in the namespace you're in with some helpful goodies