{"id":20776784,"url":"https://github.com/phpactor/language-server-protocol","last_synced_at":"2025-08-25T15:19:09.704Z","repository":{"id":43157088,"uuid":"272198260","full_name":"phpactor/language-server-protocol","owner":"phpactor","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-24T17:51:00.000Z","size":732,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T18:09:46.718Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phpactor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-14T12:31:38.000Z","updated_at":"2025-04-14T02:18:41.000Z","dependencies_parsed_at":"2024-04-04T10:47:14.985Z","dependency_job_id":null,"html_url":"https://github.com/phpactor/language-server-protocol","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpactor%2Flanguage-server-protocol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpactor%2Flanguage-server-protocol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpactor%2Flanguage-server-protocol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phpactor%2Flanguage-server-protocol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phpactor","download_url":"https://codeload.github.com/phpactor/language-server-protocol/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251758170,"owners_count":21638989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T13:11:46.585Z","updated_at":"2025-04-30T18:09:51.810Z","avatar_url":"https://github.com/phpactor.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PHP Language Server Protocol Generator\n======================================\n\n![CI](https://github.com/phpactor/language-server-protocol/workflows/CI/badge.svg)\n\nThis package _transpiles_ the `vscode-language-server-protocol` library to PHP,\nproviding the protocol classes required to create Language Server\nwith PHP.\n\nNotes on using the library\n--------------------------\n\nMost (if not all) of the upstream Typescript types have no constructors,\ntherefore the argument order of the constructors can change on _every\nrelease_.\n\nIt is therefore **strongly recommended** to use named arguments.\n\nGeneration\n----------\n\nGenerating the code:\n\n- `npm run generate`: Build and transpile\n- `npm run watch`: Watch and compile on Typescript changes.\n\nRunning the PHP tests:\n\n- `composer integrate`\n\nUsage\n-----\n\n### Deserialization\n\nThis library will use the type information form typescript to generate\n`fromArray` static constructors for each type:\n\n```php\n$item = CompletionItem::fromArray([\n    'label' =\u003e 'Foobar',\n    'kind' =\u003e 1,\n    'detail' =\u003e 'This is foobar',\n    'documentation' =\u003e [\n        'kind' =\u003e 'markdown',\n        'value' =\u003e 'Foobar',\n    ],\n    'additionalTextEdits' =\u003e [\n        [\n            'range' =\u003e [\n                'start' =\u003e [\n                    'line' =\u003e 5,\n                    'character' =\u003e 10,\n                ],\n                'end' =\u003e [\n                    'line' =\u003e 10,\n                    'character' =\u003e 10,\n                ],\n            ],\n            'newText' =\u003e 'Foobar',\n        ],\n    ],\n    'command' =\u003e [\n        'title' =\u003e 'Foobar',\n        'command' =\u003e 'my.command',\n    ],\n]);\n```\n\nWill return a fully hydrated completion item with concrete sub-types.\n\n**NOTE**: that when deserializing from a language server client request, it is\nprobably a good idea to ignore additional parameters (the second argument to\n`fromArray`). This is because it is perfectly valid to pass unknown properties\nto some of the LSP objects.\n\n### Serialization\n\nProperties in classes are public to enable JSON serialization. Call\n`json_encode($lspObject)` to get the valid LSP JSON object.\n\nContributing\n------------\n\nThis package is open source and welcomes contributions! Feel free to open a\npull request on this repository.\n\nSupport\n-------\n\n- Create an issue on the main [Phpactor](https://github.com/phpactor/phpactor) repository.\n- Join the `#phpactor` channel on the Slack [Symfony Devs](https://symfony.com/slack-invite) channel.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpactor%2Flanguage-server-protocol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpactor%2Flanguage-server-protocol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpactor%2Flanguage-server-protocol/lists"}