Closed zonuexe closed 1 year ago
This feature is under development and experimental. All of these functions, modes and terms are subject to change without notice.
There are some IDE-like features / packages for PHP development. PHP-IDE bridges projects and their IDE-like features.
We don't recommend features, but bundle some feature bridges. They are sorted alphabetically except none.
none
eglot
lsp-bridge
lsp-mode
phpactor
php-ide-phpactor
Put follows code into your .emacs (~/.emacs.d/init.el) file:
~/.emacs.d/init.el
(defun init-php-mode-setup () (add-hook 'hack-local-variables-hook #'php-ide-mode t t)) (defun init-php-ide-mode-setup (feature activate) (pcase feature (`lsp-bridge (if activate (progn (yas-minor-mode +1) (corfu-mode -1)) (yas-minor-mode -1) (corfu-mode +1))))) (with-eval-after-load 'php-ide (custom-set-variables '(php-ide-features . 'eglot) ;; and/or 'none, 'phpactor, 'lsp-mode '(php-ide-eglot-executable "psalm-language-server") ;; or "intelephense", '("php" "vendor/bin/path/to/server") ;; If you want to hide php-ide-mode from the mode line, set an empty string '(php-ide-mode-lighter "")) (add-hook 'php-mode-hook #'init-php-mode-setup) (add-hook 'php-ide-mode-functions #'init-php-ide-mode-setup))
If you don't enable IDE support by default, set '(php-ide-feature 'none)
Put follows code into .dir-locals.el in project directory:
.dir-locals.el
((nil (php-project-root . git)) (php-mode (php-ide-features . (lsp-mode))))
If you can't put .dir-locals.el in your project directory, consider the sidecar-locals package.
close https://github.com/emacs-php/php-mode/pull/656.
This feature is under development and experimental. All of these functions, modes and terms are subject to change without notice.
Motivations
There are some IDE-like features / packages for PHP development. PHP-IDE bridges projects and their IDE-like features.
IDE Features
We don't recommend features, but bundle some feature bridges. They are sorted alphabetically except
none
.none
: Does not launch any IDE features.eglot
lsp-bridge
lsp-mode
phpactor
:php-ide-phpactor
Configuration
Put follows code into your .emacs (
~/.emacs.d/init.el
) file:If you don't enable IDE support by default, set '(php-ide-feature 'none)
For per project configuration
Put follows code into
.dir-locals.el
in project directory:If you can't put
.dir-locals.el
in your project directory, consider the sidecar-locals package.close https://github.com/emacs-php/php-mode/pull/656.