pygls
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
IMPORTANT NOTE:
In order to support type-checking, we added
pydanticlibrary which requires passing keyword arguments when creating LSP models.
Here's how to create a server and register a code completion feature:
from pygls.capabilities import COMPLETION
from pygls.server import LanguageServer
from pygls.lsp import CompletionItem, CompletionList, CompletionOptions, CompletionParams
server = LanguageServer()
@server.feature(COMPLETION, CompletionOptions(trigger_characters=[',']))
def completions(params: CompletionParams):
"""Returns completion items."""
return CompletionList(
is_incomplete=False,
items=[
CompletionItem(label='"'),
CompletionItem(label='['),
CompletionItem(label=']'),
CompletionItem(label='{'),
CompletionItem(label='}'),
]
)
server.start_tcp('127.0.0.1', 8080)
Show completion list on the client:
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.
Metadata
Release files for pygls-tagls-custom 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pygls-tagls-custom-0.0.1.tar.gz | 137.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pygls_tagls_custom-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 224.4 kB
Release files / pygls-tagls-custom-0.0.1.tar.gz
| Download URL | pygls-tagls-custom-0.0.1.tar.gz |
|---|---|
| Size | 137.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed70755f77b35d216d8090fb67c4d428e423ed9798a35991e8dfbd41cd2c9885
|
|
BLAKE2b-256 checksum How to use checksums |
84fc553759319691e50d1f1266c4a291ec0ce8efab24f63f8db5fe2adabffa95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.9
|
Release files / pygls_tagls_custom-0.0.1-py3-none-any.whl
| Download URL | pygls_tagls_custom-0.0.1-py3-none-any.whl |
|---|---|
| Size | 87.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5ecedff6985dc851f9175a34f5f212aa80b4065f4fbe9fce609efcc239236841
|
|
BLAKE2b-256 checksum How to use checksums |
05e295c866dfb425be4cf7ec84e61c4297e77f617c0856540720ab0c7e45c73f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.9
|