Skip to content

PR: Use pygls for json-rpc language client and add support for lsprotocol#25937

Draft
hlouzada wants to merge 5 commits intospyder-ide:masterfrom
hlouzada:feat/lsp-protocol
Draft

PR: Use pygls for json-rpc language client and add support for lsprotocol#25937
hlouzada wants to merge 5 commits intospyder-ide:masterfrom
hlouzada:feat/lsp-protocol

Conversation

@hlouzada
Copy link
Copy Markdown
Contributor

Description of Changes

  • Wrote at least one-line docstrings (for any new functions)
  • Added unit test(s) covering the changes (if testable)
  • Included a screenshot or animation (if affecting the UI, see Licecap)

This pull request refactors and updates the LSP client provider infrastructure to support direct use of lsprotocol types, simplifying and clarifying decorator logic, and improving the handling and routing of LSP messages and responses by using pygls client:

  • The decorators send_request, send_notification, and send_response are now marker decorators that tag methods with LSP method names and kinds, instead of wrapping them to send messages directly. The actual sending is now centralized in LSPClient.perform_request(), and the class_register decorator builds registries for handlers and senders, enabling dynamic dispatch.

  • All LSP message construction and handling in providers (client.py, window.py, workspace.py) now use lsprotocol types instead of manually constructed dictionaries. This ensures better type safety and protocol compliance.

  • Updated the WorkspaceProvider code for handling workspace folder changes, watched files, and edits to support new types and more robustly assigns results to the correct workspace instances.


Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct: @hlouzada

@hlouzada hlouzada force-pushed the feat/lsp-protocol branch from 4e31ec0 to f8e5e3c Compare April 10, 2026 20:29
@hlouzada hlouzada force-pushed the feat/lsp-protocol branch from 6423b10 to b6bb32b Compare April 15, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant