From 32f90706142dcbe3dac4fb1dfc20d8ecb5fa575a Mon Sep 17 00:00:00 2001 From: Gerry Agbobada <10496163+gagbo@users.noreply.github.com> Date: Thu, 18 Jun 2020 23:59:33 +0200 Subject: [PATCH] Filter out 'eglot backend from doom-thing-at-point Context : https://github.com/joaotavora/eglot/issues/503 Fixes a bug where having eglot enabled in a buffer will make `SPC *` search the whole project for literally `LSP Identifier at point.` --- core/autoload/text.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/autoload/text.el b/core/autoload/text.el index b56917d76..f415e1e70 100644 --- a/core/autoload/text.el +++ b/core/autoload/text.el @@ -105,9 +105,11 @@ in some cases." (doom-region-end))) (thing (thing-at-point thing t)) - ((require 'xref nil 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))) (prompt (read-string (if (stringp prompt) prompt "")))))