Skip to main content

Python implementation of the Language Server Protocol.

Project description

Language Server Protocol 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-2022.0.0a2.tar.gz (65.4 kB view details)

Uploaded Source

Built Distribution

lsprotocol-2022.0.0a2-py3-none-any.whl (62.3 kB view details)

Uploaded Python 3

File details

Details for the file lsprotocol-2022.0.0a2.tar.gz.

File metadata

  • Download URL: lsprotocol-2022.0.0a2.tar.gz
  • Upload date:
  • Size: 65.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.9

File hashes

Hashes for lsprotocol-2022.0.0a2.tar.gz
Algorithm Hash digest
SHA256 e63c7825f4aa27128b3736f3e678321d0de145d72523b8805e28bee5600c86e3
MD5 b01cfca2ad19da51b3643ba851dc6127
BLAKE2b-256 e9a6971d23569cc2a28df7bd6cdd9fc2a2affde89c5fefd1d15a2e14ddbe8e7d

See more details on using hashes here.

Provenance

File details

Details for the file lsprotocol-2022.0.0a2-py3-none-any.whl.

File metadata

File hashes

Hashes for lsprotocol-2022.0.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 0096acb1ee47ed46cb3735fa952485c32a1f96b4a8ac2c7e7ed2b4290405dc7c
MD5 08517518e7a19dad9a87e4b98680544e
BLAKE2b-256 8aa54721d8f461e82473c20c8931a1193cc5254da97c1f66e075e01f3930db42

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