Skip to content

Commit

Permalink
call before/after reply from refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva committed Mar 9, 2024
1 parent baa98c1 commit 50482b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cider/nrepl/middleware/refresh.clj
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
transport
(response-for msg {:status :ok}))))

(defn- before-reply
(defn before-reply
[{:keys [before transport] :as msg}]
(when before
(transport/send
Expand All @@ -130,7 +130,7 @@
:invoked-not-resolved)
:before before})))))

(defn- after-reply
(defn after-reply
[{error ::reload/error}
{:keys [after transport] :as msg}]

Expand Down
3 changes: 3 additions & 0 deletions src/cider/nrepl/middleware/reload.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Alternative to cider.nrepl.middleware.refresh, using clj-reload instead
of tools.namespace."
(:require
[cider.nrepl.middleware.refresh :as refresh]
[clj-reload.core :as reload]
[clojure.main :refer [repl-caught]]
[clojure.string :as str]
Expand Down Expand Up @@ -47,7 +48,9 @@
(exec id
(fn []
(try
(refresh/before-reply msg)
(operation msg)
(refresh/after-reply {} msg)
(respond msg {:status :ok})
(catch Throwable error
(respond msg {:status :error
Expand Down

0 comments on commit 50482b2

Please sign in to comment.