refactor!(php): remove phpactor.el

BREAKING CHANGE: This removes the phpactor.el package in favor of LSP
support via lsp-mode/eglot. Use `+lsp` with the `:lang php` module
instead (with one of the supported LSP servers).

This was done because phpactor.el is on the way out of maintainership,
is redundant with pre-existing phpactor support in lsp-mode/eglot (or
the other, possibly superior LSP servers), and to simplify modules for
whom LSP/Eglot is *the* way to get these features.
This commit is contained in:
Henrik Lissner 2024-08-22 22:27:26 -04:00
parent b69e7d1780
commit fbfed24167
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
3 changed files with 6 additions and 32 deletions

View file

@ -12,6 +12,7 @@ This module adds support for PHP 5.3+ (including PHP8) to Doom Emacs.
- Code refactoring commands (~php-refactor-mode~) - Code refactoring commands (~php-refactor-mode~)
- Unit-test commands (~phpunit~) - Unit-test commands (~phpunit~)
- Support for ~laravel~ and ~composer~ projects (with project-specific snippets) - Support for ~laravel~ and ~composer~ projects (with project-specific snippets)
- LSP support (via the [[doom-module:+lsp]] flag)
- [[../../editor/file-templates/templates/php-mode][File templates]] - [[../../editor/file-templates/templates/php-mode][File templates]]
- [[https://github.com/hlissner/doom-snippets/tree/master/php-mode][Snippets]] - [[https://github.com/hlissner/doom-snippets/tree/master/php-mode][Snippets]]
@ -31,8 +32,8 @@ This module adds support for PHP 5.3+ (including PHP8) to Doom Emacs.
- +hack :: - +hack ::
Add support for the [[https://hacklang.org/][Hack dialect of PHP]] by Facebook. Add support for the [[https://hacklang.org/][Hack dialect of PHP]] by Facebook.
- +lsp :: - +lsp ::
Enable LSP support for ~php-mode~. Requires [[doom-module::tools lsp]] and a langserver Enable LSP support for ~php-mode~. Requires [[doom-module::tools lsp]] and a
(supports [[https://phpactor.readthedocs.io/en/develop/usage/standalone.html][phpactor]] and intelephense). langserver (supports [[https://emacs-lsp.github.io/lsp-mode/page/lsp-phpactor/][phpactor]], [[https://emacs-lsp.github.io/lsp-mode/page/lsp-intelephense/][intelephense]], [[https://emacs-lsp.github.io/lsp-mode/page/lsp-serenata/][serenata]], [[https://emacs-lsp.github.io/lsp-mode/page/lsp-php/][php-language-server]]).
- +tree-sitter :: - +tree-sitter ::
Leverages tree-sitter for better syntax highlighting and structural text Leverages tree-sitter for better syntax highlighting and structural text
editing. Requires [[doom-module::tools tree-sitter]]. editing. Requires [[doom-module::tools tree-sitter]].
@ -45,9 +46,6 @@ This module adds support for PHP 5.3+ (including PHP8) to Doom Emacs.
- [[doom-package:php-mode]] - [[doom-package:php-mode]]
- [[doom-package:php-refactor-mode]] - [[doom-package:php-refactor-mode]]
- [[doom-package:phpunit]] - [[doom-package:phpunit]]
- if [[doom-module:+lsp]]
- [[doom-package:phpactor]]
- [[doom-package:company-phpactor]]
** Hacks ** Hacks
/No hacks documented for this module./ /No hacks documented for this module./

View file

@ -50,7 +50,7 @@
:yield "use") :yield "use")
(if (not (modulep! +lsp)) (if (not (modulep! +lsp))
;; `+php-company-backend' uses `company-phpactor', `php-extras-company' or ;; `+php-company-backend' uses `php-extras-company' or
;; `company-dabbrev-code', in that order. ;; `company-dabbrev-code', in that order.
(when +php--company-backends (when +php--company-backends
(set-company-backend! 'php-mode (set-company-backend! 'php-mode
@ -78,24 +78,6 @@
"s" #'phpunit-current-test)) "s" #'phpunit-current-test))
(use-package! phpactor
:unless (modulep! +lsp)
:after php-mode
:init
(add-to-list '+php--company-backends #'company-phpactor nil 'eq)
:config
(set-lookup-handlers! 'php-mode
:definition #'phpactor-goto-definition)
(map! :localleader
:map php-mode-map
:prefix ("r" . "refactor")
"cc" #'phpactor-copy-class
"mc" #'phpactor-move-class
"oi" #'phpactor-offset-info
"t" #'phpactor-transform
"ic" #'phpactor-import-class))
(use-package! php-refactor-mode (use-package! php-refactor-mode
:hook php-mode :hook php-mode
:config :config
@ -111,13 +93,12 @@
(use-package! php-extras (use-package! php-extras
:after php-mode :after php-mode
:preface :preface
(setq php-extras-eldoc-functions-file
(concat doom-profile-cache-dir "php-extras-eldoc-functions"))
;; We'll set up company support ourselves ;; We'll set up company support ourselves
(advice-add #'php-extras-company-setup :override #'ignore) (advice-add #'php-extras-company-setup :override #'ignore)
:init
(add-to-list '+php--company-backends #'php-extras-company) (add-to-list '+php--company-backends #'php-extras-company)
:config :config
(setq php-extras-eldoc-functions-file
(concat doom-data-dir "php-extras-eldoc-functions"))
;; Silence warning if `php-extras-eldoc-functions-file' hasn't finished ;; Silence warning if `php-extras-eldoc-functions-file' hasn't finished
;; generating yet. ;; generating yet.
(defun php-extras-load-eldoc () (defun php-extras-load-eldoc ()

View file

@ -15,10 +15,5 @@
:recipe (:host github :repo "hhvm/hack-mode") :recipe (:host github :repo "hhvm/hack-mode")
:pin "ccf20511f0f2ed45d00d423c703bb91ab6a8b80c")) :pin "ccf20511f0f2ed45d00d423c703bb91ab6a8b80c"))
(unless (modulep! +lsp)
(package! phpactor :pin "6b5269ff82785a9bd1e648b2f91e5128353d5a67")
(when (modulep! :completion company)
(package! company-phpactor :pin "6b5269ff82785a9bd1e648b2f91e5128353d5a67")))
;; For building php-extras ;; For building php-extras
(package! async :pin "cff2bd0be3c78a2eb76717eed60302972fe9b8c5") (package! async :pin "cff2bd0be3c78a2eb76717eed60302972fe9b8c5")