diff --git a/core/autoload/text.el b/core/autoload/text.el index f415e1e70..79c924f4c 100644 --- a/core/autoload/text.el +++ b/core/autoload/text.el @@ -105,12 +105,15 @@ in some cases." (doom-region-end))) (thing (thing-at-point thing t)) - ((and (require 'xref nil t) (not (eq (xref-find-backend) 'eglot))) - ;; A little smarter than using `symbol-at-point', though in most cases, - ;; xref ends up using `symbol-at-point' anyway. - ;; "Most cases" doesn't cover 'eglot so we manually exclude it. - ;; See discussion in https://github.com/joaotavora/eglot/issues/503 - (xref-backend-identifier-at-point (xref-find-backend))) + ((require 'xref nil t) + ;; Eglot defines a dummy for `xref-find-backend', so we need a special + ;; case to avoid xref when using eglot. See + ;; https://github.com/joaotavora/eglot/issues/503 + (if (eq (xref-find-backend) 'eglot) + (thing-at-point 'symbol t) + ;; A little smarter than using `symbol-at-point', though in most + ;; cases, xref ends up using `symbol-at-point' anyway. + (xref-backend-identifier-at-point (xref-find-backend)))) (prompt (read-string (if (stringp prompt) prompt "")))))