https://github.com/php-lsp/language-server
https://github.com/php-lsp/language-server
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/php-lsp/language-server
- Owner: php-lsp
- License: mit
- Created: 2025-11-20T17:17:15.000Z (7 months ago)
- Default Branch: lsp
- Last Pushed: 2026-03-15T21:13:16.000Z (3 months ago)
- Last Synced: 2026-03-16T01:18:29.563Z (3 months ago)
- Language: PHP
- Size: 942 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## About Language Server Protocol
> [ALARM] This is not the final version!
---
LSP is a protocol for interaction with a client using the JSON-RPC 2.0 codec,
where arbitrary editors and IDEs act as clients.
The protocol is supported by many clients, such as:
**Most Popular Editors:**
- [VSCode](https://code.visualstudio.com/)
- [Vim (Neovim)](https://neovim.io/)
- [Atom](https://atom.io/)
- [Brackets](https://brackets.io/)
- [Lapce](https://lap.dev/lapce/)
- [GigaIDE Cloud](https://gitverse.ru/features/gigaide/cloud/)
- [JetBrains Fleet](https://www.jetbrains.com/fleet/)
- [Sublime](https://github.com/sublimelsp/LSP)
- *...etc*
**Most Popular IDE:**
- [JetBrains (PhpStorm, IDEA, RustRover, GoLand, etc)](https://www.jetbrains.com/)
- [GigaIDE Desktop](https://gitverse.ru/features/gigaide/desktop/)
- [Eclipse](https://www.eclipse.org/)
- [Emacs](https://www.gnu.org/software/emacs/)
- [QT Creator](https://www.qt.io/product/development-tools)
- [RAD Studio](https://www.embarcadero.com/products/rad-studio)
- [Visual Studio](https://marketplace.visualstudio.com/items?itemName=vsext.LanguageServerClientPreview)
- *...etc*
This project gives you the opportunity to write your own plugins for any
editor or IDE using the PHP language!
## GitHub Codespaces
You can start the project instantly in a browser — no local installation
required.
1. Click **Code → Codespaces → Create codespace on main** on the GitHub
repository page.
2. Wait for the container to build (PHP 8.4, Composer, and npm dependencies
install automatically).
3. Start the server in the terminal:
```shell
php ./bin/lsp serve 'App\Application' --port=5007
```
4. The bundled VS Code extension connects to the running server automatically.
See [docs/codespaces.md](docs/codespaces.md) for detailed setup instructions,
troubleshooting, and manual connection steps.
## Installation
```shell
# create an extension application
composer create-project php-lsp/skeleton -s dev
# allow build script to run (required once)
chmod +x bin/build
```
## Running Server
### Run From Sources
```shell
php ./bin/lsp serve App\\Application --port=5007
```
### Run From Code
```php
listen('tcp://127.0.0.1:5007');
```
### Run PHAR Assembly
```shell
composer build:run:local
```
### Run Binary Assembly
```shell
composer build:run
```
## Building Server
### Building PHAR Assembly
```shell
# build assembly
composer build
# list of assemblies
ls -la ./var/prod/
```
### Building Binary Assembly
```shell
# install dependencies (only needs to be called once)
composer build:prepare
# build assembly
composer build
# list of assemblies
ls -la ./var/prod/
```
## Running Extension Client
Please note that these are just extension examples.
Unification of the assembly without code (JS, Java, C#, etc) modification
will come later, perhaps.
### VSCode
See [client/vscode/package.json](client/vscode/package.json) to modify
the configuration.
1) Build and run editor:
```shell
# move to vscode workspace
cd client/vscode
# install dependencies
npm install
# run client
code .
```
2) Then press `F5` (in editor) to run extension