Skip to content

Commit 9f0884f

Browse files
[inspect] Add support for printing compact qualified keywords
1 parent 779518b commit 9f0884f

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## master (unreleased)
44

55
- [#353](https://github.com/clojure-emacs/orchard/pull/353): Stacktrace: flag Clojure functions as duplicate.
6+
- [#354](https://github.com/clojure-emacs/orchard/pull/354): Inspector: add support for printing compact qualified keywords.
67

78
## 0.36.0 (2025-06-29)
89

src/orchard/inspect.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1134,11 +1134,12 @@
11341134

11351135
(defn inspect-render
11361136
([{:keys [max-atom-length max-value-length max-coll-size max-nested-depth value
1137-
pretty-print only-diff]
1137+
pretty-print only-diff pov-ns]
11381138
:as inspector}]
11391139
(binding [print/*max-atom-length* max-atom-length
11401140
print/*max-total-length* max-value-length
11411141
print/*coll-show-only-diff* (boolean only-diff)
1142+
print/*pov-ns* (some-> pov-ns find-ns)
11421143
*print-length* max-coll-size
11431144
*print-level* (cond-> max-nested-depth
11441145
;; In pretty mode a higher *print-level*

test/orchard/inspect_test.clj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,6 +1777,18 @@
17771777
render
17781778
contents-section))))
17791779

1780+
(deftest compact-keywords-test
1781+
(testing "when :pov-ns is passed, use it to compact qualified keywords"
1782+
(is+ ["--- Contents:" [:newline]
1783+
" " [:value "::foo" pos?] " = " [:value "1" pos?] [:newline]
1784+
" " [:value "::str/bar" pos?] " = " [:value "2" pos?] [:newline]
1785+
" " [:value "::walk/baz" pos?] " = " [:value "3" pos?]]
1786+
(-> {::foo 1
1787+
::str/bar 2
1788+
:clojure.walk/baz 3}
1789+
(inspect {:pov-ns 'orchard.inspect-test})
1790+
render contents-section))))
1791+
17801792
(deftest tap-test
17811793
(testing "tap-current-value"
17821794
(let [proof (atom [])

0 commit comments

Comments
 (0)