Function: cider--var-to-xref-location

cider--var-to-xref-location is a byte-compiled function defined in cider-xref-backend.el.

Signature

(cider--var-to-xref-location VAR)

Documentation

Get location of definition of VAR.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-xref-backend.el
(defun cider--var-to-xref-location (var)
  "Get location of definition of VAR."
  (when-let* ((info (cider-var-info var))
              (line (nrepl-dict-get info "line"))
              (file (cider--xref-extract-file info))
              (buf (cider--find-buffer-for-file file)))
    (xref-make-buffer-location
     buf
     (with-current-buffer buf
       (save-excursion
         (goto-char 0)
         (forward-line (1- line))
         (back-to-indentation)
         (point))))))