Function: cider-eldoc-format-variable

cider-eldoc-format-variable is a byte-compiled function defined in cider-eldoc.el.

Signature

(cider-eldoc-format-variable THING ELDOC-INFO)

Documentation

Return the formatted eldoc string for a variable.

THING is the variable name. ELDOC-INFO is a p-list containing the eldoc information.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-eldoc.el
(defun cider-eldoc-format-variable (thing eldoc-info)
  "Return the formatted eldoc string for a variable.

THING is the variable name.  ELDOC-INFO is a p-list containing the eldoc
information."
  (let* ((ns (cider-plist-get eldoc-info "ns"))
         (symbol (cider-plist-get eldoc-info "symbol"))
         (docstring (or (cider--render-docstring-first-sentence eldoc-info)
                        (cider--render-docstring eldoc-info)
                        (when-let (docstring (cider-plist-get eldoc-info "docstring"))
                          (cider-docstring--trim
                           (cider-docstring--format docstring)))))
         ;; if it's a single class (and not multiple class candidates), that's it
         (maybe-class (car (cider-plist-get eldoc-info "class")))
         (formatted-var (or (when maybe-class
                              (cider-propertize maybe-class 'var))
                            (cider-eldoc-format-thing ns symbol thing 'var))))
    (when docstring
      (cider-eldoc-format-sym-doc formatted-var ns docstring))))