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.

Files for pygls, version 0.9.0
Filename, size File type Python version Upload date Hashes
Filename, size pygls-0.9.0-py3-none-any.whl (46.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pygls-0.9.0.tar.gz (43.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page