Function: cider-xref--defmethods-in-file

cider-xref--defmethods-in-file is a byte-compiled function defined in cider-xref-source.el.

Signature

(cider-xref--defmethods-in-file FILE TARGET-NS NAME)

Documentation

Return the (defmethod TARGET-NS/NAME ...) sites in FILE as plists.

A buffer opened solely to perform the scan is killed afterwards.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-xref-source.el
(defun cider-xref--defmethods-in-file (file target-ns name)
  "Return the `(defmethod TARGET-NS/NAME ...)' sites in FILE as plists.
A buffer opened solely to perform the scan is killed afterwards."
  (let* ((existing (find-buffer-visiting file))
         (buffer (or existing
                     (let ((find-file-hook nil)
                           (inhibit-message t))
                       (find-file-noselect file t)))))
    (unwind-protect
        (with-current-buffer buffer
          (when-let* ((context (cider-xref--ns-context target-ns name))
                      (regexp (cider-xref--defmethod-regexp target-ns name context)))
            (cider-xref--scan-defmethods regexp file)))
      (unless existing
        (kill-buffer buffer)))))