|
116 | 116 | The default rules: |
117 | 117 |
|
118 | 118 | * omit everything in `clojure.lang`, `java.lang.reflect` |
119 | | - * omit `clojure.core/with-bindings*` and `clojure.core/apply` |
| 119 | + * hide `clojure.core/with-bindings*` and `clojure.core/apply`, `clojure.lang.RestFn` |
120 | 120 | * hide everything in `sun.reflect` |
121 | 121 | * omit a number of functions in `clojure.test` |
122 | 122 | * terminate at `speclj.*`, `clojure.main/.*`, or `nrepl.middleware.interruptible-eval` |
123 | 123 | " |
124 | 124 | [[:name "clojure.core/apply" :hide] |
125 | 125 | [:id #"\Qclojure.lang.AFn.applyTo\E(Helper)?.*" :hide] |
| 126 | + [:id #"\Qclojure.lang.RestFn.\E.*" :hide] |
126 | 127 | [:package "clojure.lang" :omit] |
127 | 128 | [:name "clojure.core/with-bindings*" :hide] |
128 | 129 | [:package #"sun\.reflect.*" :hide] |
|
382 | 383 | dec)] |
383 | 384 | (assoc frame |
384 | 385 | :name-width width |
385 | | - :line (str line) |
386 | 386 | :name [(get *fonts* (clj-frame-font-key frame)) |
387 | 387 | (->> names' drop-last (str/join "/")) |
388 | 388 | "/" |
|
401 | 401 |
|
402 | 402 | Formatting is based on whether the frame is omitted, and whether it is a Clojure or Java frame." |
403 | 403 | {:added "0.3.0"} |
404 | | - [{:keys [file line names repeats] :as frame}] |
| 404 | + [{:keys [line names] :as frame}] |
405 | 405 | (cond |
406 | 406 | (:omitted frame) |
407 | 407 | (assoc frame |
|
415 | 415 | (let [full-name (str (:class frame) "." (:method frame))] |
416 | 416 | (assoc frame |
417 | 417 | :name [(:java-frame *fonts*) full-name] |
418 | | - :name-width (length full-name) |
419 | | - :line (str line))) |
| 418 | + :name-width (length full-name))) |
420 | 419 |
|
421 | 420 | :else |
422 | 421 | (format-clojure-frame-base frame))) |
|
536 | 535 | max-name-width (max-from rows :name-width) |
537 | 536 | ;; Allow for the colon in frames w/ a line number (this assumes there's at least one) |
538 | 537 | max-file-width (inc (max-from rows #(-> % :file length))) |
539 | | - max-line-width (max-from rows #(-> % :line length)) |
| 538 | + max-line-width (max-from rows #(-> % :line str length)) |
540 | 539 | *lines (volatile! (transient [])) |
541 | 540 | format-single-frame (fn [{:keys [name file line]} repeat-count frame-index frame-count] |
542 | | - (list |
543 | | - [{:width max-name-width} name] |
544 | | - " " |
545 | | - [{:width max-file-width |
546 | | - :font source-font} file] |
547 | | - (when line ":") |
548 | | - " " |
549 | | - [{:width max-line-width} line] |
550 | | - (when (> repeat-count 1) |
551 | | - (cond |
552 | | - (= frame-index 0) |
553 | | - (format " %s (repeats %,d times)" |
554 | | - (if (= 1 frame-count) "─" "┐") |
555 | | - repeat-count) |
556 | | - |
557 | | - (= frame-index (dec frame-count)) |
558 | | - " ┘" |
559 | | - |
560 | | - :else |
561 | | - " │"))))] |
| 541 | + (let [has-repeat? (> repeat-count 1) |
| 542 | + show-line? (or line has-repeat?) |
| 543 | + show-file? (or show-line? file)] |
| 544 | + (list |
| 545 | + [{:width max-name-width} name] |
| 546 | + (when show-file? |
| 547 | + (list |
| 548 | + " " |
| 549 | + [{:width max-file-width |
| 550 | + :font source-font} file] |
| 551 | + (when show-line? |
| 552 | + (list |
| 553 | + (if line ":" " ") |
| 554 | + [{:width max-line-width} line] |
| 555 | + (when (> repeat-count 1) |
| 556 | + (cond |
| 557 | + (= frame-index 0) |
| 558 | + (format " %s (repeats %,d times)" |
| 559 | + (if (= 1 frame-count) "─" "┐") |
| 560 | + repeat-count) |
| 561 | + |
| 562 | + (= frame-index (dec frame-count)) |
| 563 | + " ┘" |
| 564 | + |
| 565 | + :else |
| 566 | + " │")))))))))] |
562 | 567 | (doseq [[repeat-count frames] (repetitions :id rows) |
563 | 568 | [frame-index frame] (map-indexed vector frames)] |
564 | 569 | (vswap! *lines |
|
0 commit comments