Commit 9d977b4 1 parent 15e4aab commit 9d977b4 Copy full SHA for 9d977b4
File tree 2 files changed +19
-10
lines changed
2 files changed +19
-10
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## master (unreleased)
4
4
5
- ### Bugs fixed
5
+ ### Bugs Fixed
6
6
7
+ * [ #684 ] ( https://github.com/clojure-emacs/cider-nrepl/pull/684 ) : Fix delayed middleware loading issue.
7
8
* [ #683 ] ( https://github.com/clojure-emacs/cider-nrepl/pull/683 ) : Support custom ` print-method ` s in test reports.
8
9
9
10
## 0.25.4 (2020-10-08)
Original file line number Diff line number Diff line change 40
40
(or (resolve sym)
41
41
(throw (IllegalArgumentException. (format " Cannot resolve %s" sym)))))
42
42
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
+
43
55
(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)."
47
58
[fn-name handler msg]
48
59
(let [ns (symbol (namespace `~fn-name))
49
60
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
+
56
64
57
65
(defmacro ^{:arglists '([name handler-fn descriptor]
58
66
[name handler-fn trigger-it descriptor])}
You can’t perform that action at this time.
0 commit comments