Skip to content

Replace LanguageServer::Protocol::Transport with our own implementation #3533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented May 23, 2025

Motivation

This is the first step in removing the language-server_protocol dependency, in our efforts to minimize runtime dependencies that risk blocking the LSP's auto upgrades.

This PR replaces the Transport module with our own implementation. This is not a breaking change as add-ons were already not supposed to try to read or write messages to the client directly without going through the Ruby LSP.

Implementation

Implemented super simple reader and writer classes that embed the JSON RPC format for any IO. This will also make it easier to support booting the language server via sockets.

Automated Tests

There's a subtle important aspect of this. We need to capture the handles for the stdio pipes before changing the default output device ($>) or else communication is broken.

I added an integration test that will use the current launcher with an older server version to ensure that this works even when trying to boot previous versions.

@vinistock vinistock self-assigned this May 23, 2025
@vinistock vinistock added the server This pull request should be included in the server gem's release notes label May 23, 2025 — with Graphite App
Copy link
Member Author

vinistock commented May 23, 2025


How to use the Graphite Merge Queue

Add the label graphite-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock added the other Changes that aren't bugfixes, enhancements or breaking changes label May 23, 2025 — with Graphite App
@vinistock vinistock marked this pull request as ready for review May 23, 2025 18:33
@vinistock vinistock requested a review from a team as a code owner May 23, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other Changes that aren't bugfixes, enhancements or breaking changes server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant