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.0a10.tar.gz (72.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lsprotocol-2022.0.0a10-py3-none-any.whl (69.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lsprotocol-2022.0.0a10.tar.gz
Algorithm Hash digest
SHA256 2cd78770b7a4ec979f3ee3761265effd50ea0f5e858ce21bf2fba972e1783c50
MD5 94afaa5703c8a841d50282ee96306e62
BLAKE2b-256 73d98340d31edfae4ceda5fc165f52acb4332ac727ede8b12e3c84d4ec3bb46b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for lsprotocol-2022.0.0a10-py3-none-any.whl
Algorithm Hash digest
SHA256 ef516aec43c2b3c8debc06e84558ea9a64c36d635422d1614fd7fd2a45b1d291
MD5 f2725db970a20e27093c73f1731c3f81
BLAKE2b-256 9df8a68c5ce2bdcc21786db05b28f14fc4b994b45d1357da4dff7673c47e3d30

See more details on using hashes here.

Supported by

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