Function: eca-editor--xref-fallback
eca-editor--xref-fallback is a natively compiled function defined in
eca-editor.el.
Signature
(eca-editor--xref-fallback SESSION REQUEST PARAMS METHOD NO-SERVER-RESPONSE)
Documentation
Try answering the nav REQUEST of SESSION with the buffer's xref backend.
Covers eglot, etags with a loaded tags table and any custom backend. METHOD decides between definitions and references and PARAMS carry the position, mirroring the lsp-mode path. Schedule the lookup outside the process filter and return :async when a usable backend exists, otherwise return NO-SERVER-RESPONSE.
Source Code
;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-editor.el
(defun eca-editor--xref-fallback (session request params method no-server-response)
"Try answering the nav REQUEST of SESSION with the buffer's xref backend.
Covers eglot, etags with a loaded tags table and any custom
backend. METHOD decides between definitions and references and
PARAMS carry the position, mirroring the lsp-mode path. Schedule
the lookup outside the process filter and return `:async' when a
usable backend exists, otherwise return NO-SERVER-RESPONSE."
(if-let ((backend (eca-editor--xref-backend)))
(let ((buffer (current-buffer))
(position (plist-get params :position))
(references-p (string= method "textDocument/references"))
(include-declaration (eca-editor--include-declaration-p params)))
(run-at-time
0 nil
(lambda ()
(eca-api-send-request-response
session request
(condition-case err
(if (buffer-live-p buffer)
(with-current-buffer buffer
(list :status "success"
:locations (eca-editor--xref-locations
backend position references-p include-declaration)))
(list :status "error" :message "Buffer was killed"))
(error (list :status "error"
:message (error-message-string err)))))))
:async)
no-server-response))