Skip to main content

Python types for Language Server Protocol.

Project description

Language Server Protocol Types implementation for Python

lsprotocol is a Python implementation of object types used in the Language Server Protocol (LSP). This repository contains the code generator and the generated types for LSP.

Overview

LSP is used by editors to communicate with various tools to enables services like code completion, documentation on hover, formatting, code analysis, etc. The intent of this library is to allow you to build on top of the types used by LSP. This repository will be kept up to date with the latest version of LSP as it is updated.

Installation

python -m pip install lsprotocol

Usage

Using LSP types

from lsprotocol import types

position = types.Position(line=10, character=3)

Using built-in type converters

# test.py
import json
from lsprotocol import converters, types

position = types.Position(line=10, character=3)
converter = converters.get_converter()
print(json.dumps(converter.unstructure(position, unstructure_as=types.Position)))

Output:

> python test.py
{"line": 10, "character": 3}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lsprotocol-2024.0.0b1.tar.gz (75.4 kB view details)

Uploaded Source

Built Distribution

lsprotocol-2024.0.0b1-py3-none-any.whl (76.6 kB view details)

Uploaded Python 3

File details

Details for the file lsprotocol-2024.0.0b1.tar.gz.

File metadata

  • Download URL: lsprotocol-2024.0.0b1.tar.gz
  • Upload date:
  • Size: 75.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for lsprotocol-2024.0.0b1.tar.gz
Algorithm Hash digest
SHA256 d3667fb70894d361aa6c495c5c8a1b2e6a44be65ff84c21a9cbb67ebfb4830fd
MD5 032ea7f477e19881bdc4e70f55c73196
BLAKE2b-256 dc210282716d19591e573d20564ee4df65cb5cd8911bfdff35fcde1de2b54072

See more details on using hashes here.

Provenance

File details

Details for the file lsprotocol-2024.0.0b1-py3-none-any.whl.

File metadata

File hashes

Hashes for lsprotocol-2024.0.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 93785050ac155ae2be16b1ebfbd74c214feb3d3ef77b10399ce941e5ccef6ebd
MD5 63cc4aa88b7baf3df9374699f7592b5d
BLAKE2b-256 4d1b526af91cd43eba22ac7d9dbdec729dd9d91c2ad335085a61dd42307a7b35

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page