Use symbol-at-point instead of xref w/ eglot
Otherwise doom-thing-at-point-or-region will return nil, causing "Nothing under point" warnings when using lookup commands.
This commit is contained in:
parent
6b781c55c2
commit
46d6d0b586
1 changed files with 9 additions and 6 deletions
|
@ -105,12 +105,15 @@ in some cases."
|
||||||
(doom-region-end)))
|
(doom-region-end)))
|
||||||
(thing
|
(thing
|
||||||
(thing-at-point thing t))
|
(thing-at-point thing t))
|
||||||
((and (require 'xref nil t) (not (eq (xref-find-backend) 'eglot)))
|
((require 'xref nil t)
|
||||||
;; A little smarter than using `symbol-at-point', though in most cases,
|
;; Eglot defines a dummy for `xref-find-backend', so we need a special
|
||||||
;; xref ends up using `symbol-at-point' anyway.
|
;; case to avoid xref when using eglot. See
|
||||||
;; "Most cases" doesn't cover 'eglot so we manually exclude it.
|
;; https://github.com/joaotavora/eglot/issues/503
|
||||||
;; See discussion in https://github.com/joaotavora/eglot/issues/503
|
(if (eq (xref-find-backend) 'eglot)
|
||||||
(xref-backend-identifier-at-point (xref-find-backend)))
|
(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
|
(prompt
|
||||||
(read-string (if (stringp prompt) prompt "")))))
|
(read-string (if (stringp prompt) prompt "")))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue