Skip to content

Commit 605d409

Browse files
authored
Show error message if symbol is not found on ClojureDocs (#3689)
1 parent 8d67a14 commit 605d409

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
### Bugs fixed
4242

43+
- [#3689](https://github.com/clojure-emacs/cider/pull/3689): Fix `cider-clojuredocs-lookup` to show friendly error message if symbol is not found on ClojureDocs.
4344
- [#3673](https://github.com/clojure-emacs/cider/pull/3673): Fix buggy `special-display-buffer-names` check.
4445
- [#3659](https://github.com/clojure-emacs/cider/pull/3659): Fixes completions when using `flex`-like completion styles.
4546
- [#3600](https://github.com/clojure-emacs/cider/pull/3600): Fix scittle jack-in when using `cider-jack-in-clj`.

cider-clojuredocs.el

+10-8
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,16 @@ opposite of what that option dictates."
144144

145145
(defun cider-clojuredocs-lookup (sym)
146146
"Look up the ClojureDocs documentation for SYM."
147-
(let ((docs (cider-sync-request:clojuredocs-lookup (cider-current-ns) sym)))
148-
(pop-to-buffer (cider-create-clojuredocs-buffer (cider-clojuredocs--content docs)))
149-
;; highlight the symbol in question in the docs buffer
150-
(highlight-regexp
151-
(regexp-quote
152-
(or (cadr (split-string sym "/"))
153-
sym))
154-
'bold)))
147+
(if-let ((docs (cider-sync-request:clojuredocs-lookup (cider-current-ns) sym)))
148+
(progn
149+
(pop-to-buffer (cider-create-clojuredocs-buffer (cider-clojuredocs--content docs)))
150+
;; highlight the symbol in question in the docs buffer
151+
(highlight-regexp
152+
(regexp-quote
153+
(or (cadr (split-string sym "/"))
154+
sym))
155+
'bold))
156+
(user-error "ClojureDocs documentation for %s is not found" sym)))
155157

156158
;;;###autoload
157159
(defun cider-clojuredocs (&optional arg)

0 commit comments

Comments
 (0)