Skip to content
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

Set default output device to stderr #451

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

vinistock
Copy link
Member

This PR uses the same technique as Shopify/ruby-lsp#2514 to set the default output device to stderr. The default output device ($>) is where implicit calls to IO methods like puts and print go.

If we grab a reference to all of the pipes ahead of time and then switch the output device, we can ensure that any puts in the code goes to stderr instead of breaking the communication with the client.

I think this will make the connection more robust, since prints in the user's Rails application will no longer impact our communication.

@vinistock vinistock added the bugfix This PR fixes an existing bug label Sep 13, 2024
@vinistock vinistock self-assigned this Sep 13, 2024
@vinistock vinistock requested a review from a team as a code owner September 13, 2024 17:16
@vinistock vinistock requested review from andyw8 and st0012 September 13, 2024 17:16
@vinistock vinistock merged commit b5c1001 into main Sep 13, 2024
40 checks passed
@vinistock vinistock deleted the vs-set-default-output-device-to-stderr branch September 13, 2024 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants