From 47fec0e98c98b010b10fc98c04bf7496156e468f Mon Sep 17 00:00:00 2001 From: luabud Date: Fri, 10 Nov 2023 13:17:02 -0800 Subject: [PATCH 1/3] Update README --- README.md | 45 ++++++++++++++++++---------------- packages/python/pyproject.toml | 2 +- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 7be6ff8..3250f6a 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,21 @@ # Language Server Protocol types code generator -This repository contains code to generate Language Server Protocol types and classes for various languages. +This repository contains a Python implementation of a Language Server Protocol types and classes code generator for various languages. -# Code Generator usage +It simplifies the process of creating language servers for different programming languages by providing a robust and easy-to-use type generation system. -## Usage +# Usage -You will need a python environment to run the generator. Here are the steps: +You will need a Python environment to run the generator. Here are the steps: -1. Create a python environment (min supported python 3.8): `python -m venv .venv` -2. Get this tool: `python -m pip install git+https://github.com/microsoft/lsprotocol.git` -3. Run your plugin: `python -m generator --plugin dotnet --output-dir ./code` +1. Create a Python environment: `python -m venv .venv` + > **Note**: Python 3.8 is the minimum supported version +2. Install this repo's tool: `python -m pip install git+https://github.com/microsoft/lsprotocol.git` +3. Run your plugin. For example: `python -m generator --plugin dotnet --output-dir ./code` -### Command line +## Command line -Clone this repository and run `generator` like a module. +Clone this repository and run `generator` as a Python module. ```console >python -m generator --help @@ -35,27 +36,27 @@ optional arguments: Path to a directory where the generated content is ``` -### using `nox` +## Using Nox -This project uses `nox` as a task runner to run the code generator. You can install `nox` and run `build_lsp` session to generate code from spec available in the repo. +This 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. ```console > python -m pip install nox > nox --session build_lsp ``` -You can format code, run tests, and other tasks using `nox` as well. +You can also use Nox to format code, run tests and run various tasks. Run `nox --list` to see all available tasks. # Contributing plugins ## Adding a new plugin -Follow these steps to generate boiler plate code for new plugin: +Follow these steps to generate a boilerplate code for a new plugin: -1. Create a virtual environment for python using python 3.8 and activate that environment. - 1. If you have python extension for VS Code installed then run `Python: Create Environment` command. Be sure to select all the `requirements.txt` files in the repo. This should, install all packages needed and select the environment for you. +1. Create a virtual environment for Python using Python >= 3.8 and activate that environment. + 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. 1. Ensure `nox` is installed. - 1. Run `nox --list`, is nox is installed oyu should see a list of available sessions. Otherwise, run `python -m pip install nox` from the python 3.8 environment you created above. + 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. 1. Run `nox --session create_plugin` and follow the prompts to create a new plugin. Example: @@ -71,8 +72,10 @@ nox > Session create_plugin was successful. # Supported plugins -| Language | Plugin Module | Package | Notes | -| -------- | ------------------------ | --------------------------------------------------------------------------------------------------- | ----------- | -| Python | generator.plugins.python | [![PyPI](https://img.shields.io/pypi/v/lsprotocol?label=lsprotocol)](https://pypi.org/p/lsprotocol) | Active | -| Rust | generator.plugins.rust | | Development | -| Dotnet | generator.plugins.dotnet | | Development | +Below is the list of plugins already created using this package. + +| Language | Plugin Module | Package | Status | +| -------- | ------------------------ | --------------------------------------------------------------------------------------------------- | ----------------- | +| Python | generator.plugins.python | [![PyPI](https://img.shields.io/pypi/v/lsprotocol?label=lsprotocol)](https://pypi.org/p/lsprotocol) | Active | +| Rust | generator.plugins.rust | | Under development | +| Dotnet | generator.plugins.dotnet | | Under development | diff --git a/packages/python/pyproject.toml b/packages/python/pyproject.toml index dd6bc46..95524e5 100644 --- a/packages/python/pyproject.toml +++ b/packages/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "lsprotocol" -description = 'Python implementation of the Language Server Protocol.' +description = 'Python-based Language Server Protocol types code generator for various languages.' version = "2024.0.0a1" authors = [ { name = "Microsoft Corporation", email = "lsprotocol-help@microsoft.com" }, From 28c43eb9f26a9c9f42cd9873a347775adfd1e609 Mon Sep 17 00:00:00 2001 From: Luciana Abud <45497113+luabud@users.noreply.github.com> Date: Fri, 10 Nov 2023 17:54:12 -0800 Subject: [PATCH 2/3] Update packages/python/pyproject.toml Co-authored-by: Karthik Nadig --- packages/python/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/pyproject.toml b/packages/python/pyproject.toml index 95524e5..15ced8f 100644 --- a/packages/python/pyproject.toml +++ b/packages/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi" [project] name = "lsprotocol" -description = 'Python-based Language Server Protocol types code generator for various languages.' +description = 'Python types for Language Server Protocol.' version = "2024.0.0a1" authors = [ { name = "Microsoft Corporation", email = "lsprotocol-help@microsoft.com" }, From f6df0a62b782f6a376d6016dc6064eb8c34bcd2d Mon Sep 17 00:00:00 2001 From: Courtney Webster <60238438+cwebster-99@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:44:33 -0600 Subject: [PATCH 3/3] Apply suggestions from code review --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3250f6a..2af6b02 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This repository contains a Python implementation of a Language Server Protocol types and classes code generator for various languages. -It simplifies the process of creating language servers for different programming languages by providing a robust and easy-to-use type generation system. +It simplifies the creation of language servers for different programming languages by providing a robust and easy-to-use type generation system. # Usage @@ -51,12 +51,12 @@ You can also use Nox to format code, run tests and run various tasks. Run `nox - ## Adding a new plugin -Follow these steps to generate a boilerplate code for a new plugin: +Follow these steps to generate boilerplate code for a new plugin: 1. Create a virtual environment for Python using Python >= 3.8 and activate that environment. 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. 1. Ensure `nox` is installed. - 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. + 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. 1. Run `nox --session create_plugin` and follow the prompts to create a new plugin. Example: