Skip to main content

Python implementation of the 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-2023.0.1.tar.gz (69.4 kB view details)

Uploaded Source

Built Distribution

lsprotocol-2023.0.1-py3-none-any.whl (70.8 kB view details)

Uploaded Python 3

File details

Details for the file lsprotocol-2023.0.1.tar.gz.

File metadata

  • Download URL: lsprotocol-2023.0.1.tar.gz
  • Upload date:
  • Size: 69.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: RestSharp/106.13.0.0

File hashes

Hashes for lsprotocol-2023.0.1.tar.gz
Algorithm Hash digest
SHA256 cc5c15130d2403c18b734304339e51242d3018a05c4f7d0f198ad6e0cd21861d
MD5 c87b036d08806415f8943aa48ef72de1
BLAKE2b-256 9df66e80484ec078d0b50699ceb1833597b792a6c695f90c645fbaf54b947e6f

See more details on using hashes here.

File details

Details for the file lsprotocol-2023.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for lsprotocol-2023.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c75223c9e4af2f24272b14c6375787438279369236cd568f596d4951052a60f2
MD5 abbeb83bc277a9e0ea64a413646ce60e
BLAKE2b-256 8d372351e48cb3309673492d3a8c59d407b75fb6630e560eb27ecd4da03adc9a

See more details on using hashes here.

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