https://github.com/php-lsp/skeleton
PHP LSP Extension Skeleton Project
https://github.com/php-lsp/skeleton
Last synced: about 2 months ago
JSON representation
PHP LSP Extension Skeleton Project
- Host: GitHub
- URL: https://github.com/php-lsp/skeleton
- Owner: php-lsp
- License: mit
- Created: 2024-11-11T23:10:14.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-31T09:03:25.000Z (about 1 year ago)
- Last Synced: 2025-07-06T16:42:56.182Z (9 months ago)
- Language: PHP
- Homepage:
- Size: 90.8 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
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!
## 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