Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README and project description #287

Merged
merged 3 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
cwebster-99 marked this conversation as resolved.
Show resolved Hide resolved

## 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
Expand All @@ -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:
cwebster-99 marked this conversation as resolved.
Show resolved Hide resolved

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.
cwebster-99 marked this conversation as resolved.
Show resolved Hide resolved
1. Run `nox --session create_plugin` and follow the prompts to create a new plugin.

Example:
Expand All @@ -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 | <in development> | Development |
| Dotnet | generator.plugins.dotnet | <in developemnt> | 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 | <in development> | Under development |
| Dotnet | generator.plugins.dotnet | <in development> | Under development |
2 changes: 1 addition & 1 deletion packages/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"

[project]
name = "lsprotocol"
description = 'Python implementation of the Language Server Protocol.'
description = 'Python types for Language Server Protocol.'
version = "2024.0.0a1"
authors = [
{ name = "Microsoft Corporation", email = "[email protected]" },
Expand Down
Loading