Fix #3873: use thing-at-point for nox & elpy
This commit is contained in:
parent
5f47169c0e
commit
60ba42ca4a
1 changed files with 5 additions and 4 deletions
|
@ -106,10 +106,11 @@ in some cases."
|
||||||
(thing
|
(thing
|
||||||
(thing-at-point thing t))
|
(thing-at-point thing t))
|
||||||
((require 'xref nil t)
|
((require 'xref nil t)
|
||||||
;; Eglot defines a dummy for `xref-find-backend', so we need a special
|
;; Eglot, nox (a fork of eglot), and elpy implementations for
|
||||||
;; case to avoid xref when using eglot. See
|
;; `xref-backend-identifier-at-point' betray the documented purpose of
|
||||||
;; https://github.com/joaotavora/eglot/issues/503
|
;; the interface. Eglot/nox return a hardcoded string and elpy prepends
|
||||||
(if (eq (xref-find-backend) 'eglot)
|
;; the line number to the symbol.
|
||||||
|
(if (memq (xref-find-backend) '(eglot elpy nox))
|
||||||
(thing-at-point 'symbol t)
|
(thing-at-point 'symbol t)
|
||||||
;; A little smarter than using `symbol-at-point', though in most
|
;; A little smarter than using `symbol-at-point', though in most
|
||||||
;; cases, xref ends up using `symbol-at-point' anyway.
|
;; cases, xref ends up using `symbol-at-point' anyway.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue