Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Bump `orchard` to [0.37.0](https://github.com/clojure-emacs/orchard/blob/master/CHANGELOG.md#0370-2025-09-19).
* Bump `compliment` to [0.7.1](https://github.com/alexander-yakushev/compliment/blob/master/CHANGELOG.md#071-2025-09-19).
* [#950](https://github.com/clojure-emacs/cider-nrepl/pull/950): Inspect: support tidying qualified keywords.

## 0.57.0 (2025-06-29)

Expand Down
13 changes: 9 additions & 4 deletions src/cider/nrepl/middleware/inspect.clj
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,15 @@
m keys))

(defn- msg->inspector-config [msg]
(-> (select-keys msg [:page-size :max-atom-length :max-coll-size
:max-value-length :max-nested-depth :display-analytics-hint
:pretty-print :sort-maps :only-diff])
(booleanize [:pretty-print :sort-maps :only-diff])))
(as-> msg config
(select-keys config [:page-size :sort-maps :max-atom-length :max-coll-size
:max-value-length :max-nested-depth :pretty-print
:display-analytics-hint :only-diff])
(booleanize config [:pretty-print :sort-maps :only-diff])
(let [pov-ns (when (= (:tidy-qualified-keywords msg) "true")
(some-> msg :ns symbol))]
(cond-> config
pov-ns (assoc :pov-ns pov-ns)))))

(defn inspect-reply* [{:keys [view-mode] :as msg} value]
(let [config (msg->inspector-config msg)
Expand Down
34 changes: 34 additions & 0 deletions test/clj/cider/nrepl/middleware/inspect_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,40 @@
" ●normal table object pretty sort-maps"]
(value-skip-header (session/message {:op "inspect-toggle-pretty-print"}))))))

(deftest tidy-qualified-keywords-integration-test
(testing "tidy keywords disabled"
(is+ ["--- Contents:" [:newline]
" 0. " [:value ":cider.nrepl.middleware.inspect-test/own-kw" pos?]]
(-> (session/message {:op "eval"
:inspect "true"
:ns "cider.nrepl.middleware.inspect-test"
:code "[::own-kw]"})
value (section "Contents")))
(is+ ["--- Contents:" [:newline]
" 0. " [:value ":clojure.string/alias-kw" pos?]]
(-> (session/message {:op "eval"
:inspect "true"
:ns "cider.nrepl.middleware.inspect-test"
:code "[::str/alias-kw]"})
value (section "Contents"))))
(testing "tidy keywords enabled"
(is+ ["--- Contents:" [:newline]
" 0. " [:value "::own-kw" pos?]]
(-> (session/message {:op "eval"
:inspect "true"
:tidy-qualified-keywords "true"
:ns "cider.nrepl.middleware.inspect-test"
:code "[::own-kw]"})
value (section "Contents")))
(is+ ["--- Contents:" [:newline]
" 0. " [:value "::str/alias-kw" pos?]]
(-> (session/message {:op "eval"
:inspect "true"
:tidy-qualified-keywords "true"
:ns "cider.nrepl.middleware.inspect-test"
:code "[::str/alias-kw]"})
value (section "Contents")))))

(deftest print-length-independence-test
(testing "*print-length* doesn't break rendering of long collections"
(is (re-find #"showing page: \d+ of \d+"
Expand Down