Function: cider-completion-get-info-context-at-point

cider-completion-get-info-context-at-point is a byte-compiled function defined in cider-completion-context.el.

Signature

(cider-completion-get-info-context-at-point)

Documentation

Extract a context at point that is suitable for eldoc and info ops.

Note that this context is slightly different than that of cider-completion-get-context-at-point: this one does not include the current symbol at point.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-completion-context.el
(defun cider-completion-get-info-context-at-point ()
  "Extract a context at point that is suitable for eldoc and info ops.
Note that this context is slightly different than that of
`cider-completion-get-context-at-point': this one does not include
the current symbol at point."
  (when (save-mark-and-excursion
          (condition-case _
              (progn
                (up-list)
                (check-parens)
                t)
            (scan-error nil)
            (user-error nil)))
    (save-excursion
      (let* ((pref-start (cider-completion-symbol-start-pos))
             (context (cider-defun-at-point))
             (end (cider-completion-symbol-end-pos))
             (_ (beginning-of-defun-raw))
             (expr-start (point))
             (_ (if (derived-mode-p 'cider-repl-mode)
                    (goto-char (point-max))
                  (end-of-defun)))
             (expr-end (point)))
        (string-remove-suffix "\n"
                              (concat (when pref-start (substring context 0 (- pref-start expr-start)))
                                      "__prefix__"
                                      (substring context (- (- expr-end end)))))))))