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-2025.0.0.tar.gz (74.9 kB view details)

Uploaded Source

Built Distribution

lsprotocol-2025.0.0-py3-none-any.whl (76.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lsprotocol-2025.0.0.tar.gz
Algorithm Hash digest
SHA256 e879da2b9301e82cfc3e60d805630487ac2f7ab17492f4f5ba5aaba94fe56c29
MD5 ff738659955c97d7cf2d8eb0f55eec66
BLAKE2b-256 e92667b84e6ec1402f0e6764ef3d2a0aaf9a79522cc1d37738f4e5bb0b21521a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lsprotocol-2025.0.0-py3-none-any.whl
  • Upload date:
  • Size: 76.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: RestSharp/106.13.0.0

File hashes

Hashes for lsprotocol-2025.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9d78f25221f2a60eaa4a96d3b4ffae011b107537facee61d3da3313880995c7
MD5 63631cf5366d1beddc9f8b41b90324d8
BLAKE2b-256 7bf092f2d609d6642b5f30cb50a885d2bf1483301c69d5786286500d15651ef2

See more details on using hashes here.

Supported by

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