{"id":15012630,"url":"https://github.com/microsoft/lsprotocol","last_synced_at":"2025-05-15T14:08:50.175Z","repository":{"id":45741715,"uuid":"503142588","full_name":"microsoft/lsprotocol","owner":"microsoft","description":"Code generator and generated types for Language Server Protocol.","archived":false,"fork":false,"pushed_at":"2025-03-31T15:45:48.000Z","size":1518,"stargazers_count":124,"open_issues_count":8,"forks_count":25,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-05-15T00:08:18.966Z","etag":null,"topics":["csharp","python","rust"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-13T23:15:51.000Z","updated_at":"2025-05-14T18:27:42.000Z","dependencies_parsed_at":"2023-02-10T05:46:00.117Z","dependency_job_id":"52470879-e517-4cae-a2cc-dfd71e1f561d","html_url":"https://github.com/microsoft/lsprotocol","commit_stats":{"total_commits":184,"total_committers":19,"mean_commits":9.68421052631579,"dds":"0.23369565217391308","last_synced_commit":"7851838d80475ee137d2adc9b602c2651543532d"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Flsprotocol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Flsprotocol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Flsprotocol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Flsprotocol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/lsprotocol/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254355335,"owners_count":22057354,"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":["csharp","python","rust"],"created_at":"2024-09-24T19:42:57.085Z","updated_at":"2025-05-15T14:08:45.162Z","avatar_url":"https://github.com/microsoft.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Language Server Protocol types code generator \u0026 packages\n\nThis repository contains packages and tools to generate code for [Language Server Protocol](https://microsoft.github.io/language-server-protocol/) types and classes.\n\nIt simplifies the creation of language servers for different programming languages by providing a robust and easy-to-use type generation system.\n\n➡️ For instructions on how to use the **code generator**, refer to the [Usage](#usage) section.\n\n➡️ For instructions on existing **plugins and packages** for different languages, refer to the table in the [Existing packages/plugins](#existing-packagesplugins) section.\n\n➡️ For instructions on how to **create additional plugins** to support more languages, refer to the [Contributing plugins](#contributing-plugins) section.\n\n# Code Generator Usage\n\nYou will need a Python environment to run the generator. Here are the steps:\n\n1. Create a Python environment: `python -m venv .venv`\n    \u003e **Note**: Python 3.8 is the minimum supported version\n2. Activate the environment: `.venv\\Scripts\\activate` (Windows) or `source .venv/bin/activate` (Linux/macOS)\n3. Install this repo's tool: `python -m pip install git+https://github.com/microsoft/lsprotocol.git`\n4. Run your plugin. You can use the [command line](#command-line) or [Nox](#using-nox) to run the generator.\n\n## Command line\n\nClone this repository and run `generator` as a Python module.\n\nFor example: `python -m generator --plugin dotnet --output-dir ./code`\n\n```console\n\u003epython -m generator --help\nusage: __main__.py [-h] [--model [MODEL [MODEL ...]]] --plugin PLUGIN\n                   [--output-dir OUTPUT_DIR]\n\nGenerate types from LSP JSON model.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --model [MODEL [MODEL ...]], -m [MODEL [MODEL ...]]\n                        Path to a model JSON file. By default uses packaged\n                        model file.\n  --plugin PLUGIN, -p PLUGIN\n                        Name of a builtin plugin module. By default uses all\n                        plugins.\n  --output-dir OUTPUT_DIR, -o OUTPUT_DIR\n                        Path to a directory where the generated content is\n```\n\n## Using Nox\n\nThis project uses Nox as a task runner to run the code generator. You can install Nox and run a `build_lsp` session to generate code from the spec available in this repo.\n\n```console\n\u003e python -m pip install nox\n\u003e nox --session build_lsp\n```\n\nYou can also use Nox to format code, run tests and run various tasks. Run `nox --list` to see all available tasks.\n\n# Contributing plugins\n\n## Adding a new plugin\n\nFollow these steps to generate boilerplate code for a new plugin:\n\n1. Create a virtual environment for Python using Python \u003e= 3.8 and activate that environment.\n    1. If you are using the Python extension for VS Code, you can just run the **Python: Create Environment** command from the Command Palette. Be sure to select all the `requirements.txt` files in the repo. This command will install all packages needed and select the newly created environment for you.\n1. Ensure `nox` is installed.\n    1. Run `nox --list` in the terminal. If Nox is installed, you should see a list of all available sessions. Otherwise, run `python -m pip install nox` in the activated environment you created above.\n1. Run `nox --session create_plugin` and follow the prompts to create a new plugin.\n\nExample:\n\n```console\n\u003e nox --session create_plugin\nnox \u003e Running session create_plugin\nnox \u003e Creating virtual environment (virtualenv) using python.exe in .nox\\create_plugin\nEnter the name of the plugin: java\nnox \u003e Created plugin java.\nnox \u003e Session create_plugin was successful.\n```\n\n# Existing packages/plugins\n\nBelow is the list of plugins already created using this package, with their respective package links.\n\n| Language         | Plugin Module            | Package                                                                                             | Status            | Documentation                                               |\n| ---------------- | ------------------------ | --------------------------------------------------------------------------------------------------- | ----------------- | ----------------------------------------------------------- |\n| Python           | generator.plugins.python | [![PyPI](https://img.shields.io/pypi/v/lsprotocol?label=lsprotocol)](https://pypi.org/p/lsprotocol) | Active            | [Python package README](./packages/python/README.md)        |\n| Rust             | generator.plugins.rust   | [![Crates](https://img.shields.io/crates/v/lsprotocol)](https://crates.io/crates/lsprotocol)        | Active            | [Rust package README](./packages/rust/lsprotocol/README.md) |\n| Dotnet           | generator.plugins.dotnet | \u003cin development\u003e                                                                                    | Under development |\n| Crystal          |                          | [nobodywasishere/lsprotocol-crystal](https://github.com/nobodywasishere/lsprotocol-crystal)         | Active            | [CrystalDoc.info](https://crystaldoc.info/github/nobodywasishere/lsprotocol-crystal/main/index.html) |\n| \u003cin development\u003e |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Flsprotocol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Flsprotocol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Flsprotocol/lists"}