PHP Language Server (LSP 3.17) written in Rust for Visual Studio Code.
Provides IDE-level features for PHP 7.4+ projects: diagnostics, hover, go-to-definition, completion, references, rename, and more.
In development — MVP phase.
- Syntax error diagnostics (incremental, tree-sitter based)
- Hover: type/signature/PHPDoc
- Go to Definition (classes/functions/methods/properties/consts/variables)
- Completion (members, statics, variables, namespaces, keywords)
- Find All References (classes/functions/methods/properties/class const/global const/variables)
- Rename symbol (classes/functions/methods/properties/class const/global const/variables)
- Document/workspace symbols
- Composer PSR-4 autoload support
- Built-in PHP stubs (phpstorm-stubs)
Current gaps:
- Cross-file variable analysis (variable references/rename are local-scope only by design)
- Server: Rust (tokio + tower-lsp-server + tree-sitter-php)
- Client: VS Code extension (TypeScript + vscode-languageclient)
- Transport: stdio (JSON-RPC 2.0)
- Rust 1.85+ (
rustup update stable) - Node.js 20+ and npm
- Git (for submodules)
make # build server + client + stubs → .vsix make install # build + install extension into VS CodeAll available targets:
| Command | Description |
|---|---|
make / make package | Full build: server + client + stubs → .vsix |
make install | Build and install .vsix into VS Code |
make server | Build Rust binary for host platform |
make server-all | Cross-compile server for all 6 platforms |
make package-all | Universal .vsix with all platform binaries |
make client | npm ci + build extension JS |
make stubs | Init submodule + bundle phpstorm-stubs |
make check | Lint + test (Rust & TypeScript) |
make test | Run Rust tests |
make lint | cargo fmt --check, clippy, tsc --noEmit |
make fmt | Auto-format Rust code |
make clean | Remove all build artefacts |
Stubs submodule (server/data/stubs) is pulled automatically on first build if not initialized.
cd server cargo build --releasecd client npm ci npm run build# 1. Build server binary for current platform → client/bin/<platform>/ ./scripts/build-server.sh # 2. Bundle phpstorm-stubs → client/stubs/ ./scripts/bundle-stubs.sh # 3. Package VSIX cd client npx @vscode/vsce package./scripts/build-server.sh x86_64-unknown-linux-gnu # specific target ./scripts/build-server.sh --all # all 6 targets (CI)php-lsp/ ├── Makefile # Build automation ├── server/ # Rust LSP server (Cargo workspace) │ ├── data/stubs/ # phpstorm-stubs (git submodule) │ └── crates/ │ ├── php-lsp-server/ # Main binary │ ├── php-lsp-parser/ # tree-sitter PHP wrapper │ ├── php-lsp-index/ # Symbol index │ ├── php-lsp-completion/ # Completion engine │ └── php-lsp-types/ # Shared types ├── client/ # VS Code extension (TypeScript) ├── scripts/ # Build helpers (build-server.sh, bundle-stubs.sh) ├── test-fixtures/ # Test PHP projects └── docs/ # Documentation MIT