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)))
|
||||
(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 "")))))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue