PHP
PHP support is available through the PHP extension.
- Tree Sitter: https://github.com/tree-sitter/tree-sitter-php
- Language Servers:
Choosing a language server
The PHP extension offers both phpactor
and intelephense
language server support.
phpactor
is enabled by default.
Phpactor
The Zed PHP Extension can install phpactor
automatically but requires php
to installed and available in your path:
# brew install php # macOS
# sudo apt-get install php # Debian/Ubuntu
# yum install php # CentOS/RHEL
# pacman -S php # Arch Linux
which php
Intelephense
Intelephense is a proprietary language server for PHP operating under a freemium model. Certain features require purchase of a premium license. To use these features you must place your license.txt file at ~/intelephense/licence.txt
inside your home directory.
To switch to intelephense
, add the following to your settings.json
:
{
"languages": {
"PHP": {
"language_servers": ["intelephense", "!phpactor", "..."]
}
}
}
PHPDoc
Zed supports syntax highlighting for PHPDoc comments.
- Tree Sitter: claytonrcarter/tree-sitter-phpdoc