]> git.eshelyaron.com Git - emacs.git/commitdiff
Fail when eglot-find-* finds no references
authorFelicián Németh <felician.nemeth@gmail.com>
Mon, 18 Nov 2019 11:23:37 +0000 (12:23 +0100)
committerJoão Távora <joaotavora@gmail.com>
Mon, 18 Nov 2019 11:23:37 +0000 (11:23 +0000)
* eglot.el (eglot--lsp-xref-helper): Display message when no
references have been found instead of calling xref-find-references.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/339

lisp/progmodes/eglot.el

index 7171911b0e3ddc09bd85999afcb588e42e19078d..c25b7b7f082569826f000ac8fc2ae2a74864d005 100644 (file)
@@ -1872,7 +1872,9 @@ Try to visit the target file for a richer summary line."
                                method
                                :extra-params extra-params
                                :capability capability)))
-    (xref-find-references "LSP identifier at point.")))
+    (if eglot--lsp-xref-refs
+        (xref-find-references "LSP identifier at point.")
+      (eglot--message "%s returned no references" method))))
 
 (defun eglot-find-declaration ()
   "Find declaration for SYM, the identifier at point."