Skip to content

Commit 13e37e9

Browse files
Mikael Kermorgantkermorgant
authored andcommitted
use phpactor-goto-definition for definitions
1 parent d0e8e03 commit 13e37e9

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

phpactor-xref.el

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
(cl-defmethod xref-backend-definitions ((_backend (eql phpactor-xref)) symbol)
4343
(phpactor-xref--find-definitions))
4444

45+
(defun phpactor--xref-find-definitions ()
46+
"Find definitions or jump directly when only one found."
47+
(phpactor-goto-definition))
48+
4549
(cl-defmethod xref-backend-identifier-completion-table ((_backend (eql phpactor-xref)))
4650
"Return a list of terms for completions taken from the symbols in the current buffer.
4751
The current implementation returns all the words in the buffer,
@@ -54,12 +58,6 @@ which is really sub optimal."
5458
(phpactor-xref--make-xref candidate))
5559
(phpactor-xref--find-candidates)))
5660

57-
(defun phpactor-xref--find-definitions()
58-
"Return a list of candidates matching SYMBOL."
59-
(seq-map (lambda (candidate)
60-
(phpactor-xref--make-xref candidate))
61-
(phpactor-xref--find-candidates)))
62-
6361
(defun phpactor-xref--make-xref (candidate)
6462
"Return a new Xref object built from CANDIDATE."
6563
(xref-make (map-elt candidate 'match)

0 commit comments

Comments
 (0)