@@ -589,6 +589,25 @@ When there is a possible unfinished ansi control sequence,
589
589
(setq cider-repl--root-ns-regexp
590
590
(format cider-repl--root-ns-highlight-template roots)))))))))
591
591
592
+ (defvar cider-repl-spec-keywords-regexp
593
+ (concat
594
+ (regexp-opt '(" In:" " val:"
595
+ " at:" " fails at:"
596
+ " spec:" " fails spec:"
597
+ " predicate:" " fails predicate:" ))
598
+ " \\ |^"
599
+ (regexp-opt '(" :clojure.spec.alpha/spec"
600
+ " :clojure.spec.alpha/value" )
601
+ " \\ (" ))
602
+ " Regexp matching clojure.spec `explain` keywords." )
603
+
604
+ (defun cider-repl-highlight-spec-keywords (string )
605
+ " Highlight clojure.spec `explain` keywords in STRING.
606
+ Foreground of `clojure-keyword-face' is used for highlight."
607
+ (cider-add-face cider-repl-spec-keywords-regexp
608
+ 'clojure-keyword-face t nil string)
609
+ string)
610
+
592
611
(defun cider-repl-highlight-current-project (string )
593
612
" Fontify project's root namespace to make stacktraces more readable.
594
613
Foreground of `cider-stacktrace-ns-face' is used to propertize matched
@@ -604,6 +623,7 @@ namespaces. STRING is REPL's output."
604
623
605
624
(defvar cider-repl-preoutput-hook '(ansi-color-apply
606
625
cider-repl-highlight-current-project
626
+ cider-repl-highlight-spec-keywords
607
627
cider-repl-add-locref-help-echo)
608
628
" Hook run on output string before it is inserted into the REPL buffer.
609
629
Each functions takes a string and must return a modified string. Also see
0 commit comments