Download the PHP package phpactor/language-server-protocol without Composer
On this page you can find all versions of the php package phpactor/language-server-protocol. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phpactor/language-server-protocol
More information about phpactor/language-server-protocol
Files in phpactor/language-server-protocol
Package language-server-protocol
Short Description Langauge Server Protocol for PHP (transpiled)
License MIT
Informations about the package language-server-protocol
PHP Language Server Protocol Generator
This package transpiles the vscode-language-server-protocol
library to PHP,
providing the protocol classes required to create Language Server
with PHP.
Notes on using the library
Most (if not all) of the upstream Typescript types have no constructors, therefore the argument order of the constructors can change on every release.
It is therefore strongly recommended to use named arguments.
Generation
Generating the code:
npm run generate
: Build and transpilenpm run watch
: Watch and compile on Typescript changes.
Running the PHP tests:
composer integrate
Usage
Deserialization
This library will use the type information form typescript to generate
fromArray
static constructors for each type:
Will return a fully hydrated completion item with concrete sub-types.
NOTE: that when deserializing from a language server client request, it is
probably a good idea to ignore additional parameters (the second argument to
fromArray
). This is because it is perfectly valid to pass unknown properties
to some of the LSP objects.
Serialization
Properties in classes are public to enable JSON serialization. Call
json_encode($lspObject)
to get the valid LSP JSON object.
Contributing
This package is open source and welcomes contributions! Feel free to open a pull request on this repository.
Support
- Create an issue on the main Phpactor repository.
- Join the
#phpactor
channel on the Slack Symfony Devs channel.