From 0453a2186634b5e9eca8e86748cdfe4002c3b855 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felici=C3=A1n=20N=C3=A9meth?= Date: Mon, 18 Nov 2019 12:23:37 +0100 Subject: [PATCH] Fail when eglot-find-* finds no references * 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 7171911b0e3..c25b7b7f082 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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." -- 2.39.2