Skip to content

Commit

Permalink
Fix correct implementation of xref backend
Browse files Browse the repository at this point in the history
  • Loading branch information
mopemope committed Jun 14, 2020
1 parent 522278f commit 9837bbc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions meghanada.el
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 9837bbc

Please sign in to comment.