Skip to content

Commit 595ca82

Browse files
author
Eric James Michael Ritz
committed
Add a function to search Phpactor RPC documentation
This patch provides an interactive function which will prompt the user for the name of one of Phpactor's RPC commands, and will proceed to open the user's browser to the documentation on that command. For the documentation we use the Phpactor GitHub page because it's Markdown document of RPC commands contains hyperlinks to each individual command. In the future we should probably restrict the possible inputs to only those command names which are valid. However, that assumes that `phpactor.el` has a built-in list of valid commands. If not, or if we decide we do not wish to maintain such a list, then we should not bother with this addition. Finally, this patch does not update the README with any mention of the new function as I could not think of a succinct way to describe it. Signed-off-by: Eric James Michael Ritz <ejmr@no.current.address>
1 parent f1dcb52 commit 595ca82

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

phpactor.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,13 @@ function."
491491
;;
492492
;; See https://phpactor.github.io/phpactor/rpc.html#phpactor-commands
493493

494+
;;;###autoload
495+
(defun phpactor-open-rpc-documentation (command)
496+
"Open the official documentation for COMMAND."
497+
(interactive "sRPC Command: ")
498+
(let ((doc-uri (concat "https://github.com/phpactor/phpactor/blob/develop/doc/rpc.md#" command)))
499+
(browse-url doc-uri)))
500+
494501
;;;###autoload
495502
(defun phpactor-copy-class ()
496503
"Execute Phpactor RPC copy_class command."

0 commit comments

Comments
 (0)