Title: Update: Version 2.0 → Migrate to pygls + Microsoft's lsprotocol + Save Document · Issue #671 · python-lsp/python-lsp-server · GitHub
Open Graph Title: Update: Version 2.0 → Migrate to pygls + Microsoft's lsprotocol + Save Document · Issue #671 · python-lsp/python-lsp-server
X Title: Update: Version 2.0 → Migrate to pygls + Microsoft's lsprotocol + Save Document · Issue #671 · python-lsp/python-lsp-server
Description: Overview To align with Spyder IDE's remote development features (part of CZI 2022-316698 grant), the version 2.0 of the python's LSP server needs to support the latest LSP protocol version and allow to save document edditions on remote m...
Open Graph Description: Overview To align with Spyder IDE's remote development features (part of CZI 2022-316698 grant), the version 2.0 of the python's LSP server needs to support the latest LSP protocol version and allo...
X Description: Overview To align with Spyder IDE's remote development features (part of CZI 2022-316698 grant), the version 2.0 of the python's LSP server needs to support the latest LSP protocol version ...
Opengraph URL: https://github.com/python-lsp/python-lsp-server/issues/671
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Update: Version 2.0 → Migrate to pygls + Microsoft's lsprotocol + Save Document","articleBody":"# Overview\n\nTo align with Spyder IDE's remote development features (part of CZI 2022-316698 grant), the version 2.0 of the python's LSP server needs to support the latest LSP protocol version and allow to save document edditions on remote machines (enableling remote editing for Spyder). With this requirements, instead of relying on the current custom protocol implementation, it will be adopted Microsoft’s official **`lsprotocol`** package for Python. Also, the server will be refactored to use **`pygls`** for handling base TCP communications, features management and document management. This changes lays the foundation for a server more scalable, maintainable and robust, especially for remote environments.\n\n# Key Features\n\n* **Asyncio-based foundation with pygls**\n The server leverages **pygls** as its base implementation, providing a robust asyncio-driven framework for building language servers in Python. This includes built-in support for feature and command registration, multiple connection modes (TCP, STDIO, WebSocket), and automatic handling of document lifecycle events (open, change, close).\n\n* **Standards-compliant typing with lsprotocol**\n By adopting **lsprotocol**, the server uses officially maintained, up-to-date Python types that align directly with the evolving LSP specification. This ensures cleaner versioning, greater consistency, and reduced maintenance overhead compared to proprietary type definitions.\n\n* **Atomic document commit mechanism**\n To enhance reliability in remote development workflows (such as Spyder), the server supports an **opt-in atomic commit feature**. Instead of persisting edits immediately, the server can hold them in memory until a custom command (e.g., `spyder/commitEdits`) is issued. This enables atomic persistence of edits, improving resilience against latency and partial failures.\n\n# **Roadmap**\n\n1. **Migrate to pygls**\n\n * Replace the custom LSP scaffolding with **pygls** to serve as the event loop and request/notification dispatcher.\n * Ensure existing LSP features (completion, hover, diagnostics, etc.) are re-registered using pygls’s feature/command decorators with current plugin architecture.\n * Configure entry-points for TCP, STDIO, and WebSocket connection modes for compatibility with current server API.\n\n2. **Refactor configuration and plugin architecture**\n\n * Adopt **lsprotocol** types across the plugins codebase for functions signatures ensuring alignment with the official LSP specification.\n * Type check all plugins to ensure proper specification.\n * Redesign configuration loading and plugin interfaces to extend the **pygls base server**, allowing external modules to register features more cleanly.\n\n3. **Implement atomic document commit support**\n\n * Maintain in-memory buffers of document changes rather than writing them immediately to disk.\n * Introduce a custom command (e.g., `server/commitEdits`) to atomically persist pending edits when requested.\n","author":{"url":"https://github.com/hlouzada","@type":"Person","name":"hlouzada"},"datePublished":"2025-09-12T20:38:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/671/python-lsp-server/issues/671"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:762b7fe0-fac4-2b25-186f-564e356970ec |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D49A:2713AA:25E382E:32E5800:69706ADC |
| html-safe-nonce | c6e291b9aaee49015ddb1afc50b0f6bcd141943af3520870d074b8a94b1f22b4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDlBOjI3MTNBQToyNUUzODJFOjMyRTU4MDA6Njk3MDZBREMiLCJ2aXNpdG9yX2lkIjoiMzk2Mjk3MTY2ODcyNzQ5MTI5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a67aa0163f9f3c5301dbb2db64a0cb6c2f2d27d78c230f4fa7829b08c4089e06 |
| hovercard-subject-tag | issue:3411878015 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-lsp/python-lsp-server/671/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4ef5c29ab6c99863552a9a3304f9a8ca4172afd7e81b70c156803f9e05017780/python-lsp/python-lsp-server/issues/671 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4ef5c29ab6c99863552a9a3304f9a8ca4172afd7e81b70c156803f9e05017780/python-lsp/python-lsp-server/issues/671 |
| og:image:alt | Overview To align with Spyder IDE's remote development features (part of CZI 2022-316698 grant), the version 2.0 of the python's LSP server needs to support the latest LSP protocol version and allo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hlouzada |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-lsp/python-lsp-server git https://github.com/python-lsp/python-lsp-server.git |
| octolytics-dimension-user_id | 51609341 |
| octolytics-dimension-user_login | python-lsp |
| octolytics-dimension-repository_id | 341006790 |
| octolytics-dimension-repository_nwo | python-lsp/python-lsp-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 341006790 |
| octolytics-dimension-repository_network_root_nwo | python-lsp/python-lsp-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7d6181066430cc06553c8396ca201e194ae33cb9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width