Skip to content

Bump cider-nrepl to 0.56.0 #3824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

### Changes

- Bump the injected `cider-nrepl` to [0.56.0](https://github.com/clojure-emacs/cider-nrepl/blob/master/CHANGELOG.md#0560-2025-05-29).
- [cider-nrepl#941](https://github.com/clojure-emacs/cider-nrepl/pull/941): Stop vendoring Fipp dependency.
- [cider-nrepl#943](https://github.com/clojure-emacs/cider-nrepl/pull/943): Reduce debugger insrumentation bytecode footprint.
- [orchard#342](https://github.com/clojure-emacs/orchard/pull/342): Inspector: add hexdump view mode.
- [#3816](https://github.com/clojure-emacs/cider/issues/3816): **(Breaking)** Remove enrich-classpath support from cider-jack-in.
- [#3817](https://github.com/clojure-emacs/cider/issues/3817): Enable `cider-download-java-sources` by default.

Expand Down
143 changes: 29 additions & 114 deletions cider-inspector.el
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,17 @@ In particular, it does not read `cider-sexp-at-point'."
ns)))

(defun cider-inspector-pop ()
"Pop the last value off the inspector stack and render it.
See `cider-sync-request:inspect-pop' and `cider-inspector--render-value'."
"Pop the last value off the inspector stack and render it."
(interactive)
(let ((result (cider-sync-request:inspect-pop)))
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-pop"))))
(when (nrepl-dict-get result "value")
(cider-inspector--render-value result :pop))))

(defun cider-inspector-push (idx)
"Inspect the value at IDX in the inspector stack and render it.
See `cider-sync-request:inspect-push' and `cider-inspector--render-value'"
"Inspect the value at IDX in the inspector stack and render it."
(interactive)
(let ((result (cider-sync-request:inspect-push idx)))
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-push"
"idx" ,idx))))
(when (nrepl-dict-get result "value")
(push (point) cider-inspector-location-stack)
(cider-inspector--render-value result :next-inspectable))))
Expand All @@ -269,33 +268,29 @@ If EX-DATA is true, inspect ex-data of the exception instead."
`("op" "inspect-last-exception"
"index" ,index
,@(when ex-data
`("ex-data" "true")))
(cider-current-repl))))
`("ex-data" "true"))))))
(when (nrepl-dict-get result "value")
(setq cider-inspector-location-stack nil)
(cider-inspector--render-value result :next-inspectable))))

(defun cider-inspector-previous-sibling ()
"Inspect the previous sibling value within a sequential parent.
See `cider-sync-request:inspect-previous-sibling' and `cider-inspector--render-value'"
"Inspect the previous sibling value within a sequential parent."
(interactive)
(let ((result (cider-sync-request:inspect-previous-sibling)))
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-previous-sibling"))))
(when (nrepl-dict-get result "value")
(cider-inspector--render-value result))))

(defun cider-inspector-next-sibling ()
"Inspect the next sibling value within a sequential parent.
See `cider-sync-request:inspect-next-sibling' and `cider-inspector--render-value'"
"Inspect the next sibling value within a sequential parent."
(interactive)
(let ((result (cider-sync-request:inspect-next-sibling)))
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-next-sibling"))))
(when (nrepl-dict-get result "value")
(cider-inspector--render-value result))))

(defun cider-inspector--refresh-with-opts (&rest opts)
"Invokes `inspect-refresh' op with supplied extra OPTS.
Re-renders the currently inspected value."
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-refresh" ,@opts)
(cider-current-repl))))
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-refresh" ,@opts))))
(when (nrepl-dict-get result "value")
(cider-inspector--render-value result))))

Expand All @@ -309,7 +304,7 @@ Re-renders the currently inspected value."

Does nothing if already on the last page."
(interactive)
(let ((result (cider-sync-request:inspect-next-page)))
(let ((result (cider-nrepl-send-sync-request '("op" "inspect-next-page"))))
(when (nrepl-dict-get result "value")
(cider-inspector--render-value result))))

Expand All @@ -318,7 +313,7 @@ Does nothing if already on the last page."

Does nothing if already on the first page."
(interactive)
(let ((result (cider-sync-request:inspect-prev-page)))
(let ((result (cider-nrepl-send-sync-request '("op" "inspect-prev-page"))))
(when (nrepl-dict-get result "value")
(cider-inspector--render-value result))))

Expand Down Expand Up @@ -352,25 +347,21 @@ MAX-NESTED-DEPTH is the new value."
;; Disable hint about analytics feature so that it is never displayed again.
(when cider-inspector-display-analytics-hint
(customize-set-variable 'cider-inspector-display-analytics-hint nil))
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-display-analytics")
(cider-current-repl))))
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-display-analytics"))))
(when (nrepl-dict-get result "value")
(cider-inspector--render-value result :next-inspectable))))

(defun cider-inspector-toggle-pretty-print ()
"Toggle the pretty printing of values in the inspector."
(interactive)
(let ((result (cider-nrepl-send-sync-request
`("op" "inspect-toggle-pretty-print")
(cider-current-repl))))
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-toggle-pretty-print"))))
(when (nrepl-dict-get result "value")
(cider-inspector--render-value result))))

(defun cider-inspector-toggle-view-mode ()
"Toggle the view mode of the inspector between normal and object view mode."
(interactive)
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-toggle-view-mode")
(cider-current-repl))))
(let ((result (cider-nrepl-send-sync-request `("op" "inspect-toggle-view-mode"))))
(when (nrepl-dict-get result "value")
(cider-inspector--render-value result :next-inspectable))))

Expand Down Expand Up @@ -402,7 +393,9 @@ current-namespace."
(interactive (let ((ns (cider-current-ns)))
(list (cider-inspector--read-var-name-from-user ns)
ns)))
(when-let* ((result (cider-sync-request:inspect-def-current-val ns var-name)))
(when-let* ((result (cider-nrepl-send-sync-request `("op" "inspect-def-current-value"
"ns" ,ns
"var-name" ,var-name))))
(cider-inspector--render-value result)
(message "Defined current inspector value as #'%s/%s" ns var-name)))

Expand All @@ -415,13 +408,12 @@ current-namespace."
(cider-nrepl-send-request
`("op" "inspect-print-current-value"
,@(cider--nrepl-print-request-plist fill-column))
(cider-popup-eval-handler buffer)
(cider-current-repl))))
(cider-popup-eval-handler buffer))))

(defun cider-inspector-tap-current-val ()
"Sends the current Inspector current value to `tap>'."
(interactive)
(let ((response (cider-sync-request:inspect-tap-current-val)))
(let ((response (cider-nrepl-send-sync-request '("op" "inspect-tap-current-value"))))
(nrepl-dbind-response response (value err)
(if value
(message "Successfully tapped the current Inspector value")
Expand All @@ -433,94 +425,17 @@ current-namespace."
(seq-let (property value) (cider-inspector-property-at-point)
(pcase property
(`cider-value-idx
(let* ((idx value)
(response (cider-sync-request:inspect-tap-indexed idx)))
(nrepl-dbind-response response (value err)
(if value
(message "Successfully tapped the Inspector item at point")
(error "Could not tap the Inspector item at point: %s" err)))))
(cl-assert value)
(nrepl-dbind-response (cider-nrepl-send-sync-request `("op" "inspect-tap-indexed"
"idx" ,value))
(value err)
(if value
(message "Successfully tapped the Inspector item at point")
(error "Could not tap the Inspector item at point: %s" err))))
(_ (error "No object at point")))))

;; nREPL interactions

(defun cider-sync-request:inspect-pop ()
"Move one level up in the inspector stack."
(cider-nrepl-send-sync-request `("op" "inspect-pop")
(cider-current-repl)))

(defun cider-sync-request:inspect-push (idx)
"Inspect the inside value specified by IDX."
(cider-nrepl-send-sync-request `("op" "inspect-push"
"idx" ,idx)
(cider-current-repl)))

(defun cider-sync-request:inspect-previous-sibling ()
"Inspect the previous sibling value within a sequential parent."
(cider-nrepl-send-sync-request `("op" "inspect-previous-sibling")
(cider-current-repl)))

(defun cider-sync-request:inspect-next-sibling ()
"Inspect the next sibling value within a sequential parent."
(cider-nrepl-send-sync-request `("op" "inspect-next-sibling")
(cider-current-repl)))

(defun cider-sync-request:inspect-next-page ()
"Jump to the next page in paginated collection view."
(cider-nrepl-send-sync-request '("op" "inspect-next-page")
(cider-current-repl)))

(defun cider-sync-request:inspect-prev-page ()
"Jump to the previous page in paginated collection view."
(cider-nrepl-send-sync-request '("op" "inspect-prev-page")
(cider-current-repl)))

(defun cider-sync-request:inspect-set-page-size (page-size)
"Set the page size in paginated view to PAGE-SIZE."
(declare (obsolete "use `inspect-refresh' op instead." "1.15.0"))
(cider-nrepl-send-sync-request `("op" "inspect-set-page-size"
"page-size" ,page-size)
(cider-current-repl)))

(defun cider-sync-request:inspect-set-max-atom-length (max-length)
"Set the max length of nested atoms to MAX-LENGTH."
(declare (obsolete "use `inspect-refresh' op instead." "1.15.0"))
(cider-nrepl-send-sync-request `("op" "inspect-set-max-atom-length"
"max-atom-length" ,max-length)
(cider-current-repl)))

(defun cider-sync-request:inspect-set-max-coll-size (max-size)
"Set the maximum number of nested collection members to display to MAX-SIZE."
(declare (obsolete "use `inspect-refresh' op instead." "1.15.0"))
(cider-nrepl-send-sync-request `("op" "inspect-set-max-coll-size"
"max-coll-size" ,max-size)
(cider-current-repl)))

(defun cider-sync-request:inspect-set-max-nested-depth (max-nested-depth)
"Set the level of nesting to display before truncating to MAX-NESTED-DEPTH."
(declare (obsolete "use `inspect-refresh' op instead." "1.15.0"))
(cider-nrepl-send-sync-request `("op" "inspect-set-max-nested-depth"
"max-nested-depth" ,max-nested-depth)
(cider-current-repl)))

(defun cider-sync-request:inspect-def-current-val (ns var-name)
"Defines a var with VAR-NAME in NS with the current inspector value."
(cider-nrepl-send-sync-request `("op" "inspect-def-current-value"
"ns" ,ns
"var-name" ,var-name)
(cider-current-repl)))

(defun cider-sync-request:inspect-tap-current-val ()
"Sends current inspector value to tap>."
(cider-nrepl-send-sync-request '("op" "inspect-tap-current-value")
(cider-current-repl)))

(defun cider-sync-request:inspect-tap-indexed (idx)
"Sends current inspector sub-value to tap>, per IDX."
(cl-assert idx)
(cider-nrepl-send-sync-request `("op" "inspect-tap-indexed"
"idx" ,idx)
(cider-current-repl)))

(defun cider-sync-request:inspect-expr (expr ns)
"Evaluate EXPR in context of NS and inspect its result.
Set the page size in paginated view to PAGE-SIZE, maximum length of atomic
Expand All @@ -541,7 +456,7 @@ MAX-COLL-SIZE if non nil."
`("display-analytics-hint" "true"))
,@(when cider-inspector-pretty-print
`("pretty-print" "true"))))
(cider-nrepl-send-sync-request (cider-current-repl))))
(cider-nrepl-send-sync-request)))

(declare-function cider-set-buffer-ns "cider-mode")

Expand Down
2 changes: 1 addition & 1 deletion cider.el
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ the artifact.")

Used when `cider-jack-in-auto-inject-clojure' is set to `latest'.")

(defconst cider-required-middleware-version "0.55.7"
(defconst cider-required-middleware-version "0.56.0"
"The CIDER nREPL version that's known to work properly with CIDER.")

(defcustom cider-injected-middleware-version cider-required-middleware-version
Expand Down
2 changes: 1 addition & 1 deletion dev/docker-sample-project/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
:dependencies [[org.clojure/clojure "1.11.1"]
[clj-http "3.12.3"]]
:source-paths ["src"]
:plugins [[cider/cider-nrepl "0.55.7"]])
:plugins [[cider/cider-nrepl "0.56.0"]])
2 changes: 1 addition & 1 deletion dev/tramp-sample-project/project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
:dependencies [[org.clojure/clojure "1.11.1"]
[clj-http "3.12.3"]]
:source-paths ["src"]
:plugins [[cider/cider-nrepl "0.55.7"]
:plugins [[cider/cider-nrepl "0.56.0"]
[refactor-nrepl "3.9.0"]])
12 changes: 6 additions & 6 deletions doc/modules/ROOT/pages/basics/middleware_setup.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ Use the convenient plugin for defaults, either in your project's

[source,clojure]
----
:plugins [[cider/cider-nrepl "0.55.7"]]
:plugins [[cider/cider-nrepl "0.56.0"]]
----

A minimal `profiles.clj` for CIDER would be:

[source,clojure]
----
{:repl {:plugins [[cider/cider-nrepl "0.55.7"]]}}
{:repl {:plugins [[cider/cider-nrepl "0.56.0"]]}}
----

WARNING: Be careful not to place this in the `:user` profile, as this way CIDER's
Expand All @@ -43,11 +43,11 @@ run `cider-connect` or `cider-connect-cljs`.

[source,clojure]
----
:cider-clj {:extra-deps {cider/cider-nrepl {:mvn/version "0.55.7"}}
:cider-clj {:extra-deps {cider/cider-nrepl {:mvn/version "0.56.0"}}
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]}

:cider-cljs {:extra-deps {org.clojure/clojurescript {:mvn/version "1.10.339"}
cider/cider-nrepl {:mvn/version "0.55.7"}
cider/cider-nrepl {:mvn/version "0.56.0"}
cider/piggieback {:mvn/version "0.6.0"}}
:main-opts ["-m" "nrepl.cmdline" "--middleware"
"[cider.nrepl/cider-middleware,cider.piggieback/wrap-cljs-repl]"]}
Expand All @@ -65,8 +65,8 @@ NOTE: Make sure you're using https://github.com/clojurephant/clojurephant[Clojur
[source, groovy]
----
dependencies {
devImplementation 'nrepl:nrepl:0.9.0'
devImplementation 'cider:cider-nrepl:0.55.7'
devImplementation 'nrepl:nrepl:1.3.1'
devImplementation 'cider:cider-nrepl:0.56.0'
}

tasks.named('clojureRepl') {
Expand Down
6 changes: 3 additions & 3 deletions doc/modules/ROOT/pages/basics/up_and_running.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ simple - CIDER passes the extra dependencies and nREPL configuration to
your build tool in the command it runs to start the nREPL server. Here's how
this looks for `tools.deps`:

$ clojure -Sdeps '{:deps {nrepl {:mvn/version "1.3.1"} cider/cider-nrepl {:mvn/version "0.55.7"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'
$ clojure -Sdeps '{:deps {nrepl {:mvn/version "1.3.1"} cider/cider-nrepl {:mvn/version "0.56.0"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]'

TIP: If you don't want `cider-jack-in` to inject dependencies automatically, set
`cider-inject-dependencies-at-jack-in` to `nil`. Note that you'll have to setup
Expand Down Expand Up @@ -332,7 +332,7 @@ It is also possible for plain `clj`, although the command is somewhat longer:

[source,sh]
----
$ clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.55.7"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
$ clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.56.0"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/cider-middleware]"
----

Alternatively, you can start nREPL either manually or using the facilities
Expand Down Expand Up @@ -450,7 +450,7 @@ The command tunnels as well the remote port 12345 to local machine on port 12345
----
ssh -t -L 12345:localhost:12345 MY_REMOTE_SERVER \
devcontainer exec --workspace-folder /home/me/my-clj-code \
"clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version \"0.8.3\"} cider/cider-nrepl {:mvn/version \"0.25.5\"}}}' -m nrepl.cmdline -p 12345 -b 0.0.0.0 --middleware '[\"cider.nrepl/cider-middleware\"]' "
"clojure -Sdeps '{:deps {nrepl/nrepl {:mvn/version \"1.3.1\"} cider/cider-nrepl {:mvn/version \"0.56.0\"}}}' -m nrepl.cmdline -p 12345 -b 0.0.0.0 --middleware '[\"cider.nrepl/cider-middleware\"]' "
----

For this to work, we need as well to configure `devcontainer.json` with a snippet that exposes port `12345` from the container to the (remote) host:
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/ROOT/pages/cljs/shadow-cljs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ And connect to it with `cider-connect`.
...For that to work, `shadow-cljs.edn` contents like the following are assumed:

```clj
:dependencies [[cider/cider-nrepl "0.55.7"] ;; mandatory (unless it's inherited from deps.edn or otherwise present in the classpath of shadow-cljs's JVM process)
:dependencies [[cider/cider-nrepl "0.56.0"] ;; mandatory (unless it's inherited from deps.edn or otherwise present in the classpath of shadow-cljs's JVM process)
[refactor-nrepl/refactor-nrepl "3.9.0"]] ;; refactor-nrepl is optional

:nrepl {:middleware [cider.nrepl/cider-middleware ;; it's advisable to explicitly add this middleware. It's automatically added by shadow-cljs (if available in the classpath), unless `:nrepl {:cider false}`
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/ROOT/pages/cljs/up_and_running.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ or in `build.gradle`:
----
dependencies {
devImplementation 'nrepl:nrepl:1.3.1'
devImplementation 'cider:cider-nrepl:0.55.7'
devImplementation 'cider:cider-nrepl:0.56.0'
devImplementation 'cider:cider-piggieback:0.5.3'
}

Expand Down
Loading
Loading