Conversation
|
can be tested with such function (defun mk/phpactor-xref ()
"Activates xref backend using phpactor."
(make-local-variable 'xref-prompt-for-identifier)
(setq xref-prompt-for-identifier nil)
(add-hook 'xref-backend-functions #'phpactor-xref-backend nil t)) |
phpactor.el
Outdated
| (apply #'phpactor-action-dispatch (phpactor--rpc "change_visibility" arguments)))) | ||
|
|
||
| (when phpactor-use-xref | ||
| (require 'phpactor-xref)) |
There was a problem hiding this comment.
Can replace (when (require ...)) with autoload.
(autoload 'phpactor-xref-backend "phpactor-xref"
"Phpactor backend for Xref.")
phpactor-xref.el
Outdated
| ;; Created: 05 Aug 2019 | ||
| ;; Version: 0.1.0 | ||
| ;; Keywords: tools, php | ||
| ;; Package-Requires: ((phpactor "0.1.0")) |
There was a problem hiding this comment.
Please add (seq "2") into Package-Requires.
This is because Phpactor targets Emacs 24.4 and may not include the seq package.
| ;; xref backend using Phpactor. | ||
|
|
||
| ;;; Code: | ||
| (require 'xref) |
There was a problem hiding this comment.
thanks for the review !
phpactor-xref.el
Outdated
| (xref-make (map-elt candidate 'file) | ||
| (xref-make-file-location (map-elt candidate 'file) | ||
| (map-elt candidate 'line) | ||
| 0))) |
There was a problem hiding this comment.
having 0 here for the column is annoying as we already have the point position from the start of file.
| (push (list (cons 'file path) | ||
| (cons 'line (plist-get reference :line_no)) | ||
| ;; (cons 'symbol symbol) | ||
| ;; (cons 'match match) |
There was a problem hiding this comment.
maybe worth trying to fetch content of line at :line_no, which could permit to get a preview while listing candidates in minibuffer.
There was a problem hiding this comment.
that was already given using :line
f3cc067 to
26ec6ac
Compare
|
fixed 2 small thing regarding references but still need to make find-definition behave correctly |
|
|
||
| (defun phpactor--xref-find-definitions () | ||
| "Find definitions or jump directly when only one found." | ||
| (phpactor-goto-definition)) |
There was a problem hiding this comment.
this works but with a mysterious Wrong type argument: listp 2070
Thanks Nicolas Petton for inspiring this with your work on xref-js2.
479e30f to
13e37e9
Compare
I wanted to see how it would behave.
attention, this is based on branch feature/phpactor-executable-defcustom-take2