Skip to content

Commit 2a82fba

Browse files
[inspect] Show analytics -> display-analytics
1 parent d0bc4f7 commit 2a82fba

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/orchard/inspect.clj

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
:max-value-length 10000 ; To avoid printing huge graphs and Exceptions.
4444
:max-coll-size 5
4545
:max-nested-depth nil
46-
:show-analytics-hint nil
47-
:analytics-size-cutoff 100000})
46+
:display-analytics-hint nil
47+
:analytics-size-cutoff 100000})
4848

4949
(defn- reset-render-state [inspector]
5050
(-> inspector
@@ -210,15 +210,15 @@
210210
(sibling* inspector 1))
211211

212212
(defn- validate-config [{:keys [page-size max-atom-length max-value-length
213-
max-coll-size max-nested-depth show-analytics-hint
213+
max-coll-size max-nested-depth display-analytics-hint
214214
analytics-size-cutoff]
215215
:as config}]
216216
(when (some? page-size) (pre-ex (pos-int? page-size)))
217217
(when (some? max-atom-length) (pre-ex (pos-int? max-atom-length)))
218218
(when (some? max-value-length) (pre-ex (pos-int? max-value-length)))
219219
(when (some? max-coll-size) (pre-ex (pos-int? max-coll-size)))
220220
(when (some? max-nested-depth) (pre-ex (pos-int? max-nested-depth)))
221-
(when (some? show-analytics-hint) (pre-ex (= show-analytics-hint "true")))
221+
(when (some? display-analytics-hint) (pre-ex (= display-analytics-hint "true")))
222222
(when (some? analytics-size-cutoff) (pre-ex (pos-int? analytics-size-cutoff)))
223223
(select-keys config (keys default-inspector-config)))
224224

@@ -265,7 +265,7 @@
265265
(pre-ex (contains? supported-view-modes mode))
266266
(inspect-render (assoc inspector :view-mode mode)))
267267

268-
(defn show-analytics
268+
(defn display-analytics
269269
"Calculates and renders analytics for the current object."
270270
[{:keys [analytics-size-cutoff value] :as inspector}]
271271
(inspect-render
@@ -274,7 +274,7 @@
274274
(assoc :value-analysis
275275
(binding [analytics/*size-cutoff* analytics-size-cutoff]
276276
(analytics/analytics value)))
277-
(dissoc :show-analytics-hint))
277+
(dissoc :display-analytics-hint))
278278
inspector)))
279279

280280
(defn render-onto [inspector coll]
@@ -508,16 +508,16 @@
508508
inspector))
509509

510510
(defn- render-analytics
511-
[{:keys [show-analytics-hint value-analysis] :as inspector}]
512-
(if (or value-analysis show-analytics-hint)
511+
[{:keys [display-analytics-hint value-analysis] :as inspector}]
512+
(if (or value-analysis display-analytics-hint)
513513
(as-> inspector ins
514514
(render-section-header ins "Analytics")
515515
(indent ins)
516516
(if value-analysis
517517
(render-value-maybe-expand ins value-analysis)
518518
(-> ins
519519
(render-indent)
520-
(render-ln "Press 'y' or M-x cider-inspector-show-analytics to analyze this value.")))
520+
(render-ln "Press 'y' or M-x cider-inspector-display-analytics to analyze this value.")))
521521
(unindent ins))
522522
inspector))
523523

test/orchard/inspect_test.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,14 +1731,14 @@
17311731
(is+ nil (section "Analytics" rendered))))
17321732

17331733
(testing "analytics hint is displayed if requested"
1734-
(let [rendered (-> (inspect {:show-analytics-hint "true"} (range 100)) render)]
1734+
(let [rendered (-> (inspect {:display-analytics-hint "true"} (range 100)) render)]
17351735
(is+ ["--- Analytics:" [:newline]
1736-
" Press 'y' or M-x cider-inspector-show-analytics to analyze this value."
1736+
" Press 'y' or M-x cider-inspector-display-analytics to analyze this value."
17371737
[:newline] [:newline]]
17381738
(section "Analytics" rendered))))
17391739

17401740
(testing "analytics is shown when requested"
1741-
(let [rendered (-> (range 100) inspect inspect/show-analytics render)]
1741+
(let [rendered (-> (range 100) inspect inspect/display-analytics render)]
17421742
(is+ ["--- Analytics:" [:newline]
17431743
" " [:value ":count" pos?] " = " [:value "100" pos?] [:newline]
17441744
" " [:value ":types" pos?] " = " [:value "{java.lang.Long 100}" pos?] [:newline]
@@ -1751,7 +1751,7 @@
17511751
(let [rendered (-> (range 100)
17521752
inspect
17531753
(inspect/refresh {:analytics-size-cutoff 10})
1754-
inspect/show-analytics
1754+
inspect/display-analytics
17551755
render)]
17561756
(is+ (matchers/prefix
17571757
["--- Analytics:" [:newline]

0 commit comments

Comments
 (0)