Function: xref-backend-references

xref-backend-references is a byte-compiled function defined in xref.el.gz.

Signature

(xref-backend-references BACKEND IDENTIFIER)

Documentation

Find references of IDENTIFIER.

The result must be a list of xref objects. If no references can be found, return nil.

The default implementation uses xref-references-in-directory.

Implementations

(xref-backend-references (BACKEND (eql cider)) VAR) in `cider-xref-backend.el'.

Find references of VAR, per `cider-xref-references-mode'. The runtime side (the `fn-refs' op) only sees loaded namespaces; the source side covers code on disk that hasn't been evaluated yet. In `both' mode the two are combined, with runtime hits the source search already covers dropped.

(xref-backend-references (BACKEND (eql 'tex-etags)) IDENTIFIER) in `tex-mode.el'.

Find references of IDENTIFIER in TeX buffers and files.

(xref-backend-references (BACKEND (eql eglot)) IDENTIFIER) in `eglot.el'.

Undocumented

(xref-backend-references BACKEND IDENTIFIER) in `xref.el'.

Undocumented

(xref-backend-references (BACKEND (eql 'elisp)) IDENTIFIER (NIL ((&context . major-mode) derived-mode help-mode))) in `help-fns.el'.

Undocumented

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/xref.el.gz
(cl-defgeneric xref-backend-references (_backend identifier)
  "Find references of IDENTIFIER.
The result must be a list of xref objects.  If no references can
be found, return nil.

The default implementation uses `xref-references-in-directory'."
  (mapcan
   (lambda (dir)
     (message "Searching %s..." dir)
     (redisplay)
     (prog1
         (xref-references-in-directory identifier dir)
       (message "Searching %s... done" dir)))
   (let ((pr (project-current t)))
     (project-combine-directories
      (cons
       (xref--project-root pr)
       (project-external-roots pr))))))