Skip to content

Commit

Permalink
Show error message if symbol is not found on ClojureDocs (#3689)
Browse files Browse the repository at this point in the history
  • Loading branch information
katomuso authored May 30, 2024
1 parent 8d67a14 commit 605d409
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

### Bugs fixed

- [#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.
- [#3673](https://github.com/clojure-emacs/cider/pull/3673): Fix buggy `special-display-buffer-names` check.
- [#3659](https://github.com/clojure-emacs/cider/pull/3659): Fixes completions when using `flex`-like completion styles.
- [#3600](https://github.com/clojure-emacs/cider/pull/3600): Fix scittle jack-in when using `cider-jack-in-clj`.
Expand Down
18 changes: 10 additions & 8 deletions cider-clojuredocs.el
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,16 @@ opposite of what that option dictates."

(defun cider-clojuredocs-lookup (sym)
"Look up the ClojureDocs documentation for SYM."
(let ((docs (cider-sync-request:clojuredocs-lookup (cider-current-ns) sym)))
(pop-to-buffer (cider-create-clojuredocs-buffer (cider-clojuredocs--content docs)))
;; highlight the symbol in question in the docs buffer
(highlight-regexp
(regexp-quote
(or (cadr (split-string sym "/"))
sym))
'bold)))
(if-let ((docs (cider-sync-request:clojuredocs-lookup (cider-current-ns) sym)))
(progn
(pop-to-buffer (cider-create-clojuredocs-buffer (cider-clojuredocs--content docs)))
;; highlight the symbol in question in the docs buffer
(highlight-regexp
(regexp-quote
(or (cadr (split-string sym "/"))
sym))
'bold))
(user-error "ClojureDocs documentation for %s is not found" sym)))

;;;###autoload
(defun cider-clojuredocs (&optional arg)
Expand Down

0 comments on commit 605d409

Please sign in to comment.