You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Reorder nav: Editor Setup before Manual Installation, since most
editors auto-install PHPantom.
- Split editor setup into Automatic Installation (Zed, VS Code) and
Manual Installation sections so users can quickly find their editor.
- Convert editor and agent setup pages from HTML <details> dropdowns
to proper markdown headers for better navigation and rendering.
- Clean up PHPStorm instructions (remove redundant download step).
- Restructure installation page with Latest Release (tabbed), Latest
Main (cargo install --git for testing fixes), and Build from Source.
- Add cargo-binstall as an installation option.
- Remove redundant Zed binary note (covered by section intro).
- Remove navigation.expand so sidebar sections start collapsed.
Copy file name to clipboardExpand all lines: docs/agent-setup.md
+3-7Lines changed: 3 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,7 @@
2
2
3
3
AI coding agents can use PHPantom for the same code intelligence editors get. The agent starts `phpantom_lsp` over LSP and consults it (diagnostics, go-to-definition, hover types) as it reads and edits PHP, so its changes are grounded in real type information instead of guesses.
4
4
5
-
<details>
6
-
<summary><b>Claude Code</b></summary>
5
+
## Claude Code
7
6
8
7
Install the PHPantom plugin from its marketplace:
9
8
@@ -18,11 +17,9 @@ Beyond per-file code intelligence, the plugin puts `phpantom_lsp` on the agent's
18
17
19
18
To use a specific binary instead of the downloaded one, set the `PHPANTOM_SERVER_PATH` environment variable to its path, or put `phpantom_lsp` on your `PATH`.
20
19
21
-
</details>
20
+
## Opencode
22
21
23
-
<details>
24
-
<summary><b>Opencode</b></summary>
25
-
You can add this to your `opencode.json` file, it will be invoked when the AI uses the edit tool to edit a PHP file from within opencode.
22
+
Add this to your `opencode.json` file. It will be invoked when the AI uses the edit tool to edit a PHP file from within Opencode.
26
23
27
24
```json
28
25
{
@@ -37,4 +34,3 @@ You can add this to your `opencode.json` file, it will be invoked when the AI us
37
34
```
38
35
39
36
You can add additional extensions to invoke it on if appropriate for your project.
PHPantom communicates over stdin/stdout using the standard [Language Server Protocol](https://microsoft.github.io/language-server-protocol/). Any editor with LSP support can use it. Point the client at the `phpantom_lsp` binary with `php` as the file type. No special initialization options are required.
3
+
PHPantom communicates over stdin/stdout using the standard [Language Server Protocol](https://microsoft.github.io/language-server-protocol/). Any editor with LSP support can use it. No special initialization options are required.
4
4
5
-
<details>
6
-
<summary><b>Zed</b></summary>
5
+
## Automatic Installation
6
+
7
+
These editors download and manage the PHPantom binary for you. To use a newer version than what your editor provides, [install it manually](installation.md) and put `phpantom_lsp` on your `PATH`.
8
+
9
+
### Zed
7
10
8
11
PHPantom is supported directly by Zed's official PHP extension, no separate PHPantom extension needed. Install (or update) the PHP extension from Zed's Extensions panel, then add PHPantom to your Zed `settings.json`:
9
12
@@ -17,12 +20,15 @@ PHPantom is supported directly by Zed's official PHP extension, no separate PHPa
17
20
}
18
21
```
19
22
20
-
If you'd prefer to use a locally built binary, put `phpantom_lsp` on your `PATH` and the extension will use it instead of downloading one.
23
+
### VS Code / Cursor
24
+
25
+
Install the [PHPantom extension](https://marketplace.visualstudio.com/items?itemName=phpantom.phpantom) from the VS Code Marketplace. It automatically downloads the language server binary and starts it when you open a PHP file.
26
+
27
+
## Manual Installation
21
28
22
-
</details>
29
+
These editors require you to [install PHPantom](installation.md) first.
23
30
24
-
<details>
25
-
<summary><b>Neovim</b></summary>
31
+
### Neovim
26
32
27
33
PHPantom is included in [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig). If you use nvim-lspconfig, enable it with:
Install the [PHPantom extension](https://marketplace.visualstudio.com/items?itemName=phpantom.phpantom) from the VS Code Marketplace. It automatically downloads the language server binary and starts it when you open a PHP file.
50
-
51
-
</details>
50
+
### PHPStorm
52
51
53
-
<details>
54
-
<summary><b>PHPStorm</b></summary>
52
+
1. Install [LSP4IJ](https://plugins.jetbrains.com/plugin/23257-lsp4ij) from **Editor > Plugins**, then restart PHPStorm.
55
53
56
-
1.**Download PHPantom LSP binary**
54
+
2. Navigate to **Languages & Frameworks > Language Servers** and click **+** to add a new server:
57
55
58
-
* Get it from [GitHub Releases](https://github.com/PHPantom-dev/phpantom_lsp/releases/latest)
59
-
* Extract the binary to a preferred location
56
+
-**Name:**`PHPantom`
57
+
-**Command:** path to your `phpantom_lsp` binary
58
+
-**Mapping:** set `PHP` on both the **Language** tab and the **File Type** tab. Setting both ensures PHPStorm activates the server reliably.
60
59
61
-
2.**Install and configure LSP plugin**
60
+
{ width="600" }
62
61
63
-
* Go to **Editor → Plugins** and install [LSP4IJ](https://plugins.jetbrains.com/plugin/23257-lsp4ij)
64
-
* Restart PHPStorm
65
-
* Navigate to **Languages & Frameworks → Language Servers**
66
-
* Click **+** to add a new server
62
+
{ width="600" }
67
63
68
-
* Name: `PHPantom`
69
-
* Command: path to your PHPantom binary
70
-
* Mapping: set `PHP` on both the **Language** tab and the **File Type** tab (the dialogs are identical). Setting both ensures PHPStorm activates the server reliably.
64
+
### Sublime Text
71
65
72
-
<imgwidth="779"height="645"alt="PHPStorm new language server dialog"src="https://github.com/user-attachments/assets/2da88e68-d012-476e-82e7-977dbfcd9653" />
66
+
1. Open the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`), type `Package Control: Install Package`, and install **LSP**.
73
67
74
-
<imgwidth="779"height="645"alt="PHPStorm language server mapping dialog"src="https://github.com/user-attachments/assets/62358f9e-973c-487d-ac17-098d7dab007e" />
75
-
76
-
</details>
77
-
78
-
<details>
79
-
<summary><b>Sublime Text</b></summary>
80
-
81
-
1.**Install the LSP package.** Open the Command Palette (`Ctrl+Shift+P` on Linux/Windows, `Cmd+Shift+P` on macOS), type `Package Control: Install Package`, press Enter, then search for `LSP` and install it.
82
-
83
-
2.**Configure PHPantom.** Open the Command Palette again and type `Preferences: LSP Server Configurations`. This opens `LanguageServers.sublime-settings`. Add the following:
68
+
2. Open the Command Palette again, type `Preferences: LSP Server Configurations`, and add:
84
69
85
70
```json
86
71
{
@@ -95,12 +80,9 @@ Install the [PHPantom extension](https://marketplace.visualstudio.com/items?item
95
80
96
81
Make sure `phpantom_lsp` is on your `PATH`, or replace it with the full path to the binary.
97
82
98
-
</details>
99
-
100
-
<details>
101
-
<summary><b>Helix</b></summary>
83
+
### Helix
102
84
103
-
Helix has built-in LSP support. Add PHPantom to your `languages.toml` (typically `~/.config/helix/languages.toml`):
85
+
Add PHPantom to your `languages.toml` (typically `~/.config/helix/languages.toml`):
104
86
105
87
```toml
106
88
[language-server.phpantom]
@@ -111,13 +93,10 @@ name = "php"
111
93
language-servers = ["phpantom"]
112
94
```
113
95
114
-
</details>
96
+
### Emacs (eglot)
115
97
116
-
<details>
117
-
<summary><b>Emacs (eglot)</b></summary>
118
-
119
-
> [!NOTE]
120
-
> This configuration is untested. If you get it working (or run into issues), please [open an issue](../../issues).
98
+
!!! note
99
+
This configuration is untested. If you get it working (or run into issues), please [open an issue](https://github.com/PHPantom-dev/phpantom_lsp/issues).
121
100
122
101
Eglot is built into Emacs 29+. Add to your `init.el`:
123
102
@@ -129,13 +108,10 @@ Eglot is built into Emacs 29+. Add to your `init.el`:
129
108
130
109
Then open a PHP file and run `M-x eglot`.
131
110
132
-
</details>
133
-
134
-
<details>
135
-
<summary><b>Emacs (lsp-mode)</b></summary>
111
+
### Emacs (lsp-mode)
136
112
137
-
> [!NOTE]
138
-
> This configuration is untested. If you get it working (or run into issues), please [open an issue](../../issues).
113
+
!!! note
114
+
This configuration is untested. If you get it working (or run into issues), please [open an issue](https://github.com/PHPantom-dev/phpantom_lsp/issues).
139
115
140
116
Add to your `init.el`:
141
117
@@ -150,15 +126,12 @@ Add to your `init.el`:
150
126
151
127
Then open a PHP file and run `M-x lsp`.
152
128
153
-
</details>
129
+
### Kate
154
130
155
-
<details>
156
-
<summary><b>Kate</b></summary>
131
+
!!! note
132
+
This configuration is untested. If you get it working (or run into issues), please [open an issue](https://github.com/PHPantom-dev/phpantom_lsp/issues).
157
133
158
-
> [!NOTE]
159
-
> This configuration is untested. If you get it working (or run into issues), please [open an issue](../../issues).
160
-
161
-
Kate (KDE) has built-in LSP support. Open **Settings → Configure Kate → LSP Client → User Server Settings** and add:
134
+
Open **Settings > Configure Kate > LSP Client > User Server Settings** and add:
162
135
163
136
```json
164
137
{
@@ -171,6 +144,4 @@ Kate (KDE) has built-in LSP support. Open **Settings → Configure Kate → LSP
171
144
}
172
145
```
173
146
174
-
</details>
175
-
176
147
For AI coding agent setup, see [Agent Setup](agent-setup.md).
Copy file name to clipboardExpand all lines: docs/installation.md
+32-7Lines changed: 32 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,8 @@
1
-
# Installation
1
+
# Manual Installation
2
+
3
+
Most editors install PHPantom automatically (see [Editor Setup](editor-setup.md)). Use these methods when your editor doesn't manage the binary for you, or when you want a specific version.
4
+
5
+
## Latest Release
2
6
3
7
=== "Cargo"
4
8
@@ -8,6 +12,16 @@
8
12
9
13
See [phpantom_lsp on crates.io](https://crates.io/crates/phpantom_lsp).
0 commit comments