php-lsp / skeleton
The skeleton application for the Language Server Protocol extension
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
Type:project
Requires
- php: ^8.1
- monolog/monolog: ^3.8
- php-lsp/dispatcher: ^1.0
- php-lsp/hydrator-type-lang: ^1.0
- php-lsp/kernel: ^1.0
- php-lsp/protocol: ^1.0
- php-lsp/router: ^1.0
- php-lsp/rpc: ^1.0
- php-lsp/server-driver-react: ^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: 2024-11-18 05:15:44 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 # allow build script to run (required once) chmod +x bin/build
Running Extension 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');
Build And Run (Using Composer)
# build server assembly composer build # run server assembly composer run
Build And Run (Using Binaries)
# build server assembly ./bin/build # run server assembly php ./var/prod/build.phar serve App\\Application --port=5007
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