php-lsp / skeleton
The skeleton application for the Language Server Protocol extension
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 2
Open Issues: 0
Type:project
Requires
- php: ^8.4
- monolog/monolog: ^3.8
- php-lsp/bridge-hydrator-type-lang: ^1.0
- php-lsp/bridge-server-react: ^1.0
- php-lsp/ext-document-manager: ^1.0
- php-lsp/kernel: ^1.0
- php-lsp/protocol: ^1.0
- php-lsp/workspace: ^1.0
Requires (Dev)
- behat/behat: ^3.16
- friendsofphp/php-cs-fixer: ^3.64
- php-lsp/protocol-generator: ^1.0
- phpstan/phpstan: ^2.0
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^10.5|^11.5
- symfony/var-dumper: ^6.4|^7.0
This package is auto-updated.
Last update: 2025-01-31 09:03:28 UTC
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:
Most Popular IDE:
- JetBrains (PhpStorm, IDEA, RustRover, GoLand, etc)
- GigaIDE Desktop
- Eclipse
- Emacs
- QT Creator
- RAD Studio
- Visual Studio
- ...etc
This project gives you the opportunity to write your own plugins for any editor or IDE using the PHP language!
Installation
# 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
php ./bin/lsp serve App\\Application --port=5007
Run From Code
<?php declare(strict_types=1); require __DIR__ . '/vendor/autoload.php'; $app = new \App\Application('dev', true); $app->listen('tcp://127.0.0.1:5007');
Run PHAR Assembly
composer build:run:local
Run Binary Assembly
composer build:run
Building Server
Building PHAR Assembly
# build assembly composer build # list of assemblies ls -la ./var/prod/
Building Binary Assembly
# 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 to modify the configuration.
- Build and run editor:
# move to vscode workspace cd client/vscode # install dependencies npm install # run client code .
- Then press
F5
(in editor) to run extension