Function: cider-complete-at-point

cider-complete-at-point is a byte-compiled function defined in cider-completion.el.

Signature

(cider-complete-at-point)

Documentation

Complete the symbol at point.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-completion.el
(defun cider-complete-at-point ()
  "Complete the symbol at point."
  (when-let* ((bounds (or (bounds-of-thing-at-point 'symbol)
                          (cons (point) (point))))
              (bounds-string (buffer-substring (car bounds) (cdr bounds))))
    (when (and (cider-connected-p)
               (not (or (cider-in-string-p) (cider-in-comment-p))))
      (let* (last-bounds-string
             last-result
             (complete
              (lambda (_string)
                ;; We do NOT use the string the completion table is called with:
                ;; under some completion styles it can be an empty string, which is
                ;; unreliable.  The bounds of the symbol at point are dependable.
                ;;
                ;; Caching just within the function is sufficient. Keeping it local
                ;; ensures that it will not extend across different CIDER sessions.
                (unless (string= bounds-string last-bounds-string)
                  (setq last-bounds-string bounds-string)
                  (setq last-result (cider-complete bounds-string)))
                last-result)))
        (list (car bounds) (cdr bounds)
              (cider--completion-table complete)
              :annotation-function #'cider-annotate-symbol
              :affixation-function #'cider-affixate-symbol
              :company-kind #'cider-company-symbol-kind
              :company-doc-buffer #'cider-create-compact-doc-buffer
              :company-location #'cider-company-location
              :company-docsig #'cider-company-docsig)))))