Auto-diffing LSP client for remote Jupyter notebooks.
Project description
📋 waxtablet
Waxtablet is an efficient, opinionated client for notebooks to interface with the Language Server Protocol.
It handles document synchronization and request processing, so you can integrate LSP (e.g., basedpyright or ty) into a remote notebook product, without needing to manually synchronize every document edit, which can be slow or tricky running over the network.
Use cases
In a remote Jupyter kernel, the primary requests would be:
textDocument/hover: Information about a symbol at a given line and character.textDocument/completion: Get a list of completions while typing.textDocument/semanticTokens: Compute semantic highlighting for a range of code.
While LSP has been designed for local IDEs, waxtablet stores its own internal representation of all the cells. The goal is to get diagnostics from a remote server without needing to literally buffer or send every keystroke.
Example
import waxtablet
# Initialize an empty notebook (default).
lsp = waxtablet.NotebookLsp(
server=["basedpyright", "--stdio"],
# server=["ty", "server"],
)
await lsp.start()
# Example usage
await lsp.add_cell("cell1", index=0, kind=waxtablet.CellKind.CODE)
await lsp.set_text("cell1", "print('Hello, world!')\ndic")
await lsp.hover("cell1", line=0, character=0)
await lsp.completion("cell1", line=1, character=3)
# Shutdown the server
await lsp.shutdown()
License
Code is released under the MIT License.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file waxtablet-0.2.2.tar.gz.
File metadata
- Download URL: waxtablet-0.2.2.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c992275e894c0329b2dead122a7b201cd8cb8c791eab935b2aaf717b73f2a9e3
|
|
| MD5 |
baf82dc4a9a4abd0e489d3a7b9f65e56
|
|
| BLAKE2b-256 |
0c43ff72b36f263ff32b6c8d47f74ec56e60180d8ca29ea86aa23975785b1bb7
|
File details
Details for the file waxtablet-0.2.2-py3-none-any.whl.
File metadata
- Download URL: waxtablet-0.2.2-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.23.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
752a12b34a1210b683fd5c80713763d55076260db8eb7c9aa31e363ce83e68bf
|
|
| MD5 |
73bb7789105cd6bff6681a150442e1a2
|
|
| BLAKE2b-256 |
b7df3974579df57823468a7d9efde36687a8c04672a2dea885bdc2e96c440ee0
|