+4








eb3c4b0e46
Co-authored-by: Raunak Raj <nkray21111983@gmail.com> Co-authored-by: Thorsten Ball <mrnugget@gmail.com> Co-authored-by: Bennet <bennet@zed.dev> Co-authored-by: Marshall Bowers <elliott.codes@gmail.com> Co-authored-by: Joseph T Lyons <JosephTLyons@gmail.com> Co-authored-by: Mikayla <mikayla@zed.dev> Co-authored-by: Jason <jason@zed.dev> Co-authored-by: Antonio Scandurra <me@as-cii.com> Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com> Co-authored-by: Marshall <marshall@zed.dev> Co-authored-by: Nathan Sobo <nathan@zed.dev> Co-authored-by: Jason Mancuso <7891333+jvmncs@users.noreply.github.com> Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
37 lines
1.3 KiB
Markdown
37 lines
1.3 KiB
Markdown
# PHP
|
|
|
|
PHP support is available through the [PHP extension](https://github.com/zed-industries/zed/tree/main/extensions/php).
|
|
|
|
- Tree Sitter: https://github.com/tree-sitter/tree-sitter-php
|
|
- Language Servers:
|
|
- [phpactor](https://github.com/phpactor/phpactor)
|
|
- [intelephense](https://github.com/bmewburn/vscode-intelephense/)
|
|
|
|
## Choosing a language server
|
|
|
|
The PHP extension offers both `phpactor` and `intelephense` language server support.
|
|
|
|
`phpactor` is enabled by default.
|
|
|
|
## Intelephense
|
|
|
|
[Intelephense](https://intelephense.com/) is a [proprietary](https://github.com/bmewburn/vscode-intelephense/blob/master/LICENSE.txt#L29) language server for PHP operating under a freemium model. Certain features require purchase of a [premium license](https://intelephense.com/). To use these features you must place your [license.txt file](https://intelephense.com/faq.html) at `~/intelephense/licence.txt` inside your home directory.
|
|
|
|
To switch to `intelephense`, add the following to your `settings.json`:
|
|
|
|
```json
|
|
{
|
|
"languages": {
|
|
"PHP": {
|
|
"language_servers": ["intelephense", "!phpactor", "..."]
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
## PHPDoc
|
|
|
|
Zed supports syntax highlighting for PHPDoc comments.
|
|
|
|
- Tree Sitter: [claytonrcarter/tree-sitter-phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc)
|