From 1f8a041e25c280eeac37d516bc77eb3b8f0d40f9 Mon Sep 17 00:00:00 2001 From: Naoya Yamashita Date: Fri, 5 Jul 2024 06:55:51 +0900 Subject: [PATCH 1/3] call cider-docstring--format after checking argument --- cider-eldoc.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cider-eldoc.el b/cider-eldoc.el index 4c094b06c..9a3266272 100644 --- a/cider-eldoc.el +++ b/cider-eldoc.el @@ -218,9 +218,10 @@ information." (symbol (lax-plist-get eldoc-info "symbol")) (docstring (or (cider--render-docstring-first-sentence eldoc-info) (cider--render-docstring eldoc-info) - (cider-docstring--trim - (cider-docstring--format - (lax-plist-get eldoc-info "docstring"))))) + (when (lax-plist-get eldoc-info "docstring") + (cider-docstring--trim + (cider-docstring--format + (lax-plist-get eldoc-info "docstring")))))) ;; if it's a single class (and not multiple class candidates), that's it (maybe-class (car (lax-plist-get eldoc-info "class"))) (formatted-var (or (when maybe-class From 7311fe12032c24732659304e3e83111825c1898d Mon Sep 17 00:00:00 2001 From: Naoya Yamashita Date: Fri, 5 Jul 2024 07:31:24 +0900 Subject: [PATCH 2/3] use when-let for DRY --- cider-eldoc.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cider-eldoc.el b/cider-eldoc.el index 9a3266272..1137046bb 100644 --- a/cider-eldoc.el +++ b/cider-eldoc.el @@ -218,10 +218,9 @@ information." (symbol (lax-plist-get eldoc-info "symbol")) (docstring (or (cider--render-docstring-first-sentence eldoc-info) (cider--render-docstring eldoc-info) - (when (lax-plist-get eldoc-info "docstring") + (when-let (docstring (lax-plist-get eldoc-info "docstring")) (cider-docstring--trim - (cider-docstring--format - (lax-plist-get eldoc-info "docstring")))))) + (cider-docstring--format docstring))))) ;; if it's a single class (and not multiple class candidates), that's it (maybe-class (car (lax-plist-get eldoc-info "class"))) (formatted-var (or (when maybe-class From 1b5de7fb3b73b1fc5a8e092699a434de89fc854b Mon Sep 17 00:00:00 2001 From: Naoya Yamashita Date: Fri, 5 Jul 2024 07:32:31 +0900 Subject: [PATCH 3/3] add CHANGELOG entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11ba72139..1a4a3a0ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - [#3719](https://github.com/clojure-emacs/cider/pull/3719): Remove duplicated keybinding. - Bump the injected `cider-nrepl` to [0.49.1](https://github.com/clojure-emacs/cider-nrepl/blob/master/CHANGELOG.md#0491-2024-06-30). - Reduces the minimal supported Clojure version to 1.10.0 (from 1.10.3). +- [#3722](https://github.com/clojure-emacs/cider/pull/3722): Call `cider-docstring--format` after checking argument ### Bugs fixed