From 9837bbca48ae546b2a4f656c1b7919329841132c Mon Sep 17 00:00:00 2001 From: mopemope Date: Sun, 14 Jun 2020 22:47:47 +0900 Subject: [PATCH] Fix correct implementation of xref backend --- meghanada.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/meghanada.el b/meghanada.el index 8852fee..8e5f386 100644 --- a/meghanada.el +++ b/meghanada.el @@ -1936,12 +1936,17 @@ e.g. java.lang.annotation)." (cl-defmethod xref-backend-definitions ((_backend (eql meghanada)) symbol) (if (and meghanada--server-process (process-live-p meghanada--server-process)) (when symbol - (meghanada--send-request "jd" #'meghanada--jump-callback + (let ((output (meghanada--send-request-sync "jd" (format "\"%s\"" (buffer-file-name)) (meghanada--what-line) (meghanada--what-column) - (format "\"%s\"" symbol))) - (message "client connection not established"))) + (format "\"%s\"" symbol)))) + (when output + (let ((file (nth 0 output)) + (line (nth 1 output)) + (column (nth 2 output))) + (list (xref-make file (xref-make-file-location file line column)))))) + (message "client connection not established")))) (cl-defmethod xref-backend-references ((_backend (eql meghanada)) symbol) (if (and meghanada--server-process (process-live-p meghanada--server-process))