Skip to main content

a pythonic generic language server (pronounced like "pie glass").

Project description

pygls

PyPI Version Build Status !pyversions license Documentation Status

pygls (pronounced like "pie glass") is a pythonic generic implementation of the Language Server Protocol for use as a foundation for writing language servers using Python (e.g. Python, XML, etc.). It allows you to write your own language server in just a few lines of code.

Quick Intro

Here's how to create a server and register a code completion feature:

from pygls.features import COMPLETION
from pygls.server import LanguageServer
from pygls.types import CompletionItem, CompletionList, CompletionParams

server = LanguageServer()

@server.feature(COMPLETION, trigger_characters=[','])
def completions(params: CompletionParams):
    """Returns completion items."""
    return CompletionList(False, [
        CompletionItem('"'),
        CompletionItem('['),
        CompletionItem(']'),
        CompletionItem('{'),
        CompletionItem('}')
    ])

server.start_tcp('localhost', 8080)

Show completion list on the client:

completions

Docs and Tutorial

The full documentation and a tutorial is available at https://pygls.readthedocs.io/en/latest/.

Let Us Know How You Are Using pygls

Submit a Pull Request (PR) with your information against the implementations document.

License

Apache-2.0

Contributing

Your contributions to pygls are welcome! Please review the Contributing and Code of Conduct documents for how to get started.

Donation

Open Law Library is a 501(c)(3) tax exempt organization.Help us maintain our open source projects and open the law to all with a donation.

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

pygls-0.9.0.tar.gz (43.0 kB view details)

Uploaded Source

Built Distribution

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

pygls-0.9.0-py3-none-any.whl (46.1 kB view details)

Uploaded Python 3

File details

Details for the file pygls-0.9.0.tar.gz.

File metadata

  • Download URL: pygls-0.9.0.tar.gz
  • Upload date:
  • Size: 43.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.6

File hashes

Hashes for pygls-0.9.0.tar.gz
Algorithm Hash digest
SHA256 0be0dce93745cba445b7a2568910ca7e45a3865347f01860eff9ed3e37e64e7b
MD5 671a80fc70d03a4c47c9ecad0989481a
BLAKE2b-256 00a42ea259b55ce8c678115e18e86d1969c6c6fc133d88ab877fdf2b33cb48e3

See more details on using hashes here.

File details

Details for the file pygls-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: pygls-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 46.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.6.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.6

File hashes

Hashes for pygls-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8fab2fa1286ce23b9f33c5779950ce6293122f564d8cc4c669907f39953f5c89
MD5 2c28edd6bf5c4479520e331f99ef3b6e
BLAKE2b-256 8e818375485b2db5b34f932ecc065833f7a2ff63a5fe6781de65cb5d1048d842

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