phpactor.el
phpactor.el copied to clipboard
Implement RPC features
https://phpactor.github.io/phpactor/rpc.html
Editor Actions
- [ ] return
- [ ] return_choice
- [x] echo #3
- [ ] error
- [x] collection #39
- [x] open_file #3
- [x] close_file #39
- [ ] file_references
- [x] input_callback 51f82e8f7a7967a9bbc7813fc8aab7d92fee7401
- [x] information #3
- [x] replace_file_source
Phpactor Commands
- [x] complete
- [ ] class_search
- [x] goto_definition 22e285e097cc20b9ecc83786a99ad29c55e0b9fb
- [x] copy_class https://github.com/emacs-php/phpactor.el/pull/10
- [x] move_class https://github.com/emacs-php/phpactor.el/pull/10
- [x] offset_info
- [x] transform
- [x] class_new
- [x] class_inflect
- [ ] references
- [x] extract_constant
- [ ] generate_method
- [x] generate_accessor e16cec9e0480a37142b65ddca3db60695c597336
- [x] context_menu https://github.com/emacs-php/phpactor.el/pull/24
- [x] navigate
- [x] status b6f68f704ed48b768140e08b4c392fe5b050126a
- [x] import_class https://github.com/emacs-php/phpactor.el/pull/34 by @kermorgant
Update. #3
Update https://github.com/emacs-php/phpactor.el/pull/10
Update #16
Update #17
I'm currently trying to implement context_menu
here, however, I'm struggling a lot since it seems to be the case that the function phpactor-action-input-callback is using the wrong callback (this is changed in my branch), and also often provides invalid arguments to the RPC (I believe this is PHPActor's fault, though).
For example:
calling M-x phpactor-context-menu
on Book.php L18C24
, choosing rename_variable
, in my branch causes the error:
user-error: Invalid arguments "current_path" for handler "rename_variable", valid arguments: "path", "source", "offset", "name", "name_suggestion", "scope"
:current_path
doesn't seem to be any different to :path
, so I'm not sure why phpactor sometimes specifies one instead of the other.
I've also encountered an issue where phpactor provided a parameter which was missing the key choices
(when trying to rename variable), causing the function phpactor--action-input-parameters
to throw an error.
I hope what I've said makes some kind of sense - I think the fixes will need to be on phpactor's end)
@dantleech any insight?
If I haven't been clear here, please let me know and I can try to clarify.
current_path
is what the context menu needs, however this is mapped to path
by Phpactor (you may also be interested in the Handler which will progressively ask for missing information via. RPC callbacks).
What would help is if you had the request and response, if you don't know already this can be easily found by adding the following in a Phpactor config file (e.g.
$HOME/.config/phpactor/phpactor.yml`)
rpc.store_replay: true
You can then easily debug the last RPC command sent to Phpactor with:
$ phpactor rpc --replay --verbose
and see the exact request and response.
Let me know if you have any other questions, I'm having a look at getting Emacs running on my side, so might be able to help out.
Update #22, Implemented context menu
action. (Thanks @dantleech )
And phpactor
package is now available on MELPA and MELPA stable.
Update #34, Implemented import_class
action.
(Thanks @kermorgant, and I invited him as a member of @emacs-php/developers)