Skip to content

Commit d39ff45

Browse files
plexusbbatsov
authored andcommitted
Allow starting the sideloader for the tooling session
CIDER's deferred loading of middleware means that requires can happen during all kinds of nREPL ops, many of which are performed over the tooling session. To make this work via the sideloader we need it to be active both on the regular session and on the tooling session, so provide a flag for starting it in either session.
1 parent 28fac9c commit d39ff45

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
* [#3020](https://github.com/clojure-emacs/cider/issues/3020): Fix session linking on Windows, e.g. when jumping into a library on the classpath.
1313
* [#3031](https://github.com/clojure-emacs/cider/pull/3031): Fix `cider-eval-defun-up-to-point` failing to match delimiters correctly in some cases, resulting in reader exceptions.
14+
* [#3039](https://github.com/clojure-emacs/cider/pull/3039): Allow starting the sideloader for the tooling session
1415

1516
## 1.1.1 (2021-05-24)
1617

cider-client.el

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,14 @@ Signal an error if it is not supported."
162162
(unless (cider-nrepl-op-supported-p op)
163163
(user-error "`%s' requires the nREPL op \"%s\" (provided by cider-nrepl)" this-command op)))
164164

165-
(defun cider-nrepl-send-request (request callback &optional connection)
165+
(defun cider-nrepl-send-request (request callback &optional connection tooling)
166166
"Send REQUEST and register response handler CALLBACK.
167167
REQUEST is a pair list of the form (\"op\" \"operation\" \"par1-name\"
168168
\"par1\" ... ).
169169
If CONNECTION is provided dispatch to that connection instead of
170-
the current connection. Return the id of the sent message."
171-
(nrepl-send-request request callback (or connection (cider-current-repl 'any 'ensure))))
170+
the current connection. Return the id of the sent message.
171+
If TOOLING is truthy then the tooling session is used."
172+
(nrepl-send-request request callback (or connection (cider-current-repl 'any 'ensure)) tooling))
172173

173174
(defun cider-nrepl-send-sync-request (request &optional connection abort-on-input)
174175
"Send REQUEST to the nREPL server synchronously using CONNECTION.

cider-eval.el

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,16 @@ When invoked with a prefix ARG the command doesn't prompt for confirmation."
208208
(when (member "sideloader-lookup" status)
209209
(cider-request:sideloader-provide id type name))))))
210210

211-
(defun cider-request:sideloader-start (&optional connection)
211+
(defun cider-request:sideloader-start (&optional connection tooling)
212212
"Perform the nREPL \"sideloader-start\" op.
213-
If CONNECTION is nil, use `cider-current-repl'."
213+
If CONNECTION is nil, use `cider-current-repl'.
214+
If TOOLING is truthy then the operation is perfomed over the tooling
215+
session, rather than the regular session."
214216
(cider-ensure-op-supported "sideloader-start")
215217
(cider-nrepl-send-request `("op" "sideloader-start")
216218
(cider-sideloader-lookup-handler)
217-
connection))
219+
connection
220+
tooling))
218221

219222
(defun cider-request:sideloader-provide (id type file &optional connection)
220223
"Perform the nREPL \"sideloader-provide\" op for ID, TYPE and FILE.

0 commit comments

Comments
 (0)