Skip to content

Commit eb6090d

Browse files
committed
docs: improve editor setup and installation pages
- 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.
1 parent 1d180af commit eb6090d

5 files changed

Lines changed: 73 additions & 81 deletions

File tree

docs/agent-setup.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
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.
44

5-
<details>
6-
<summary><b>Claude Code</b></summary>
5+
## Claude Code
76

87
Install the PHPantom plugin from its marketplace:
98

@@ -18,11 +17,9 @@ Beyond per-file code intelligence, the plugin puts `phpantom_lsp` on the agent's
1817

1918
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`.
2019

21-
</details>
20+
## Opencode
2221

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.
2623

2724
```json
2825
{
@@ -37,4 +34,3 @@ You can add this to your `opencode.json` file, it will be invoked when the AI us
3734
```
3835

3936
You can add additional extensions to invoke it on if appropriate for your project.
40-
</details>

docs/editor-setup.md

Lines changed: 36 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
# Editor Setup
22

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. 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.
44

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
710

811
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`:
912

@@ -17,12 +20,15 @@ PHPantom is supported directly by Zed's official PHP extension, no separate PHPa
1720
}
1821
```
1922

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
2128

22-
</details>
29+
These editors require you to [install PHPantom](installation.md) first.
2330

24-
<details>
25-
<summary><b>Neovim</b></summary>
31+
### Neovim
2632

2733
PHPantom is included in [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig). If you use nvim-lspconfig, enable it with:
2834

@@ -41,46 +47,25 @@ vim.lsp.config['phpantom'] = {
4147
vim.lsp.enable('phpantom')
4248
```
4349

44-
</details>
45-
46-
<details>
47-
<summary><b>VS Code / Cursor</b></summary>
48-
49-
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
5251

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.
5553

56-
1. **Download PHPantom LSP binary**
54+
2. Navigate to **Languages & Frameworks > Language Servers** and click **+** to add a new server:
5755

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.
6059

61-
2. **Install and configure LSP plugin**
60+
![PHPStorm new language server dialog](https://github.com/user-attachments/assets/2da88e68-d012-476e-82e7-977dbfcd9653){ width="600" }
6261

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+
![PHPStorm language server mapping dialog](https://github.com/user-attachments/assets/62358f9e-973c-487d-ac17-098d7dab007e){ width="600" }
6763

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
7165

72-
<img width="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**.
7367

74-
<img width="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:
8469

8570
```json
8671
{
@@ -95,12 +80,9 @@ Install the [PHPantom extension](https://marketplace.visualstudio.com/items?item
9580

9681
Make sure `phpantom_lsp` is on your `PATH`, or replace it with the full path to the binary.
9782

98-
</details>
99-
100-
<details>
101-
<summary><b>Helix</b></summary>
83+
### Helix
10284

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`):
10486

10587
```toml
10688
[language-server.phpantom]
@@ -111,13 +93,10 @@ name = "php"
11193
language-servers = ["phpantom"]
11294
```
11395

114-
</details>
96+
### Emacs (eglot)
11597

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).
121100

122101
Eglot is built into Emacs 29+. Add to your `init.el`:
123102

@@ -129,13 +108,10 @@ Eglot is built into Emacs 29+. Add to your `init.el`:
129108

130109
Then open a PHP file and run `M-x eglot`.
131110

132-
</details>
133-
134-
<details>
135-
<summary><b>Emacs (lsp-mode)</b></summary>
111+
### Emacs (lsp-mode)
136112

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).
139115

140116
Add to your `init.el`:
141117

@@ -150,15 +126,12 @@ Add to your `init.el`:
150126

151127
Then open a PHP file and run `M-x lsp`.
152128

153-
</details>
129+
### Kate
154130

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).
157133

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:
162135

163136
```json
164137
{
@@ -171,6 +144,4 @@ Kate (KDE) has built-in LSP support. Open **Settings → Configure Kate → LSP
171144
}
172145
```
173146

174-
</details>
175-
176147
For AI coding agent setup, see [Agent Setup](agent-setup.md).

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ You may want to jump to:
2929

3030
## Useful Links
3131

32-
- [Installation](installation.md) and [Editor Setup](editor-setup.md)
32+
- [Editor Setup](editor-setup.md) and [Manual Installation](installation.md)
3333
- [Configuration Reference](configuration.md)
3434
- [CLI Reference](cli.md)
3535
- [Development Roadmap](todo.md)

docs/installation.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff 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
26

37
=== "Cargo"
48

@@ -8,6 +12,16 @@
812

913
See [phpantom_lsp on crates.io](https://crates.io/crates/phpantom_lsp).
1014

15+
=== "Cargo binstall"
16+
17+
```bash
18+
cargo binstall phpantom_lsp
19+
```
20+
21+
[cargo-binstall](https://github.com/cargo-bins/cargo-binstall) downloads
22+
pre-built binaries instead of compiling from source, so installation
23+
takes seconds instead of minutes.
24+
1125
=== "Homebrew"
1226

1327
```bash
@@ -34,13 +48,24 @@
3448
(Alpine). The `-unknown-linux-gnu` name is retained for compatibility
3549
with existing installers.
3650

37-
=== "Build from Source"
51+
## Latest Main (Unreleased)
3852

39-
See [Building from Source](BUILDING.md) for full instructions. Quick version:
53+
Install the latest `main` branch to get fixes and features that haven't
54+
been released yet. Useful for verifying bug fixes or testing new features.
4055

41-
```bash
42-
cargo build --release
43-
# Binary is at target/release/phpantom_lsp
44-
```
56+
```bash
57+
cargo install --git https://github.com/PHPantom-dev/phpantom_lsp --branch main phpantom_lsp
58+
```
59+
60+
## Build from Source
61+
62+
See [Building from Source](BUILDING.md) for full instructions. Quick version:
63+
64+
```bash
65+
git clone https://github.com/PHPantom-dev/phpantom_lsp
66+
cd phpantom_lsp
67+
cargo build --release
68+
# Binary is at target/release/phpantom_lsp
69+
```
4570

4671
Once installed, see [Editor Setup](editor-setup.md) to configure your editor.

zensical.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ edit_uri = "edit/main/docs/"
88
nav = [
99
{ "Home" = "index.md" },
1010
{ "Getting Started" = [
11-
{ "Installation" = "installation.md" },
1211
{ "Editor Setup" = "editor-setup.md" },
1312
{ "Agent Setup" = "agent-setup.md" },
13+
{ "Manual Installation" = "installation.md" },
1414
]},
1515
{ "Reference" = [
1616
{ "Configuration" = "configuration.md" },

0 commit comments

Comments
 (0)