Function: cider--xref-reject-runtime-overlap

cider--xref-reject-runtime-overlap is a byte-compiled function defined in cider-xref-backend.el.

Signature

(cider--xref-reject-runtime-overlap RUNTIME SOURCE)

Documentation

Drop RUNTIME xref items whose file already appears in SOURCE.

The source search reports precise occurrences, so for any file it covers the coarser runtime hit (which points at the referring var's definition, not the call site) would only duplicate it. What survives is mainly references the compiler generated from macros, which leave no textual trace for the scan.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-xref-backend.el
(defun cider--xref-reject-runtime-overlap (runtime source)
  "Drop RUNTIME xref items whose file already appears in SOURCE.
The source search reports precise occurrences, so for any file it covers the
coarser runtime hit (which points at the referring var's definition, not the
call site) would only duplicate it.  What survives is mainly references the
compiler generated from macros, which leave no textual trace for the scan."
  (let ((covered (make-hash-table :test 'equal)))
    (dolist (item source)
      (when-let* ((file (cider--xref-item-file item)))
        (puthash (file-truename file) t covered)))
    (seq-remove (lambda (item)
                  (when-let* ((file (cider--xref-item-file item)))
                    (gethash (file-truename file) covered)))
                runtime)))