File tree Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Original file line number Diff line number Diff line change 22
33## master (unreleased)
44
5- ### Bugs fixed
5+ ### Bugs Fixed
66
7+ * [ #684 ] ( https://github.com/clojure-emacs/cider-nrepl/pull/684 ) : Fix delayed middleware loading issue.
78* [ #683 ] ( https://github.com/clojure-emacs/cider-nrepl/pull/683 ) : Support custom ` print-method ` s in test reports.
89
910## 0.25.4 (2020-10-08)
Original file line number Diff line number Diff line change 4040 (or (resolve sym)
4141 (throw (IllegalArgumentException. (format " Cannot resolve %s" sym)))))
4242
43+ (defn- handler-future
44+ " Check whether a delay exists in the `delayed-handlers`. Otherwise make a delay
45+ out of `fn-name` and place it in the atom. "
46+ [sym ns fn-name]
47+ (or (get @delayed-handlers sym)
48+ (get (swap! delayed-handlers assoc sym
49+ (delay
50+ (locking require-lock
51+ (require ns )
52+ (resolve-or-fail fn-name))))
53+ sym)))
54+
4355(defmacro run-deferred-handler
44- " Make a delay out of `fn-name` and place it in `delayed-handlers` atom at compile time.
45- Require and invoke the delay at run-time with arguments `handler` and
46- `msg`. `fn-name` must be a namespaced symbol (unquoted)."
56+ " Require and invoke the handler delay at run-time with arguments `handler` and `msg`.
57+ `fn-name` must be a namespaced symbol (unquoted)."
4758 [fn-name handler msg]
4859 (let [ns (symbol (namespace `~fn-name))
4960 sym (symbol (name `~fn-name))]
50- (swap! delayed-handlers assoc sym
51- (delay
52- (locking require-lock
53- (require `~ns)
54- (resolve-or-fail `~fn-name))))
55- `(@(get @delayed-handlers '~sym) ~handler ~msg)))
61+ `(@(handler-future '~sym '~ns '~fn-name)
62+ ~handler ~msg)))
63+
5664
5765(defmacro ^{:arglists '([name handler-fn descriptor]
5866 [name handler-fn trigger-it descriptor])}
You can’t perform that action at this time.
0 commit comments