Skip to content

WIP: Ensure sorbet-runtime available for runner #340

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/ruby_lsp/ruby_lsp_rails/runner_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ def initialize
# If we can't set the session ID, continue
end

stdin, stdout, stderr, wait_thread = Open3.popen3(
env = {}
if ENV["BUNDLE_GEMFILE"]
env = { "BUNDLE_GEMFILE" => ENV["BUNDLE_GEMFILE"] }
end

# TODO: fix signature
stdin, stdout, stderr, wait_thread = T.unsafe(Open3).popen3(
env,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can't simply pass ENV here and have it inherit the entire environment.

That would also make it easier to test, you could just add a bogus ENV value and verify that popen3 gets invoked with it.

"bin/rails",
"runner",
"#{__dir__}/server.rb",
Expand Down