Function: cider-affixate-symbol
cider-affixate-symbol is a byte-compiled function defined in
cider-completion.el.
Signature
(cider-affixate-symbol CANDIDATES)
Documentation
Affixate CANDIDATES for display, aligning their annotations into a column.
Return a list of (CANDIDATE PREFIX SUFFIX) triples, where SUFFIX carries the
same type/namespace information as cider-annotate-symbol, left-padded so the
annotations line up across candidates. This is the richer successor to
annotation-function (Emacs 28+); completion UIs that support it (the
built-in *Completions*, Corfu, Vertico, ...) render aligned annotations,
while company keeps using the annotation-function we provide alongside.
Source Code
;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-completion.el
(defun cider-affixate-symbol (candidates)
"Affixate CANDIDATES for display, aligning their annotations into a column.
Return a list of (CANDIDATE PREFIX SUFFIX) triples, where SUFFIX carries the
same type/namespace information as `cider-annotate-symbol', left-padded so the
annotations line up across candidates. This is the richer successor to
`annotation-function' (Emacs 28+); completion UIs that support it (the
built-in `*Completions*', Corfu, Vertico, ...) render aligned annotations,
while `company' keeps using the `annotation-function' we provide alongside."
(let ((width (seq-reduce (lambda (acc cand) (max acc (length cand))) candidates 0)))
(mapcar
(lambda (cand)
(let ((annotation (cider-annotate-symbol cand)))
(list cand ""
(if (and annotation (not (string-empty-p annotation)))
(concat (make-string (max 1 (- (1+ width) (length cand))) ?\s)
(propertize (string-trim-left annotation)
'face 'completions-annotations))
""))))
candidates)))