Skip to content

Conversation

@Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Dec 13, 2025

After #21111, Homebrew's ruby was no longer added to the PATH in the ruby-lsp-setup.sh file. This meant that all subsequent setup steps were using the wrong Ruby, leading to the wrong Gem setup being used. This PR adds ruby back to the PATH to (mostly) fix vscode.

Unfortunately, the test-prof issues (see #21220) are preventing RuboCop from working out of the box, so vscode is still slightly broken. The workaround is to comment out the test-prof plugin in .rubocop.yml temporarily. That shouldn't be necessary once the next version of test-prof is released and gets merged in.

Copilot AI review requested due to automatic review settings December 13, 2025 20:04
@Rylan12 Rylan12 enabled auto-merge December 13, 2025 20:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the VSCode Ruby LSP setup by ensuring Homebrew's ruby is available in PATH. After PR #21111, the setup-ruby-path function in ruby.sh no longer adds Homebrew's ruby binary directory to PATH (it only exports HOMEBREW_RUBY_PATH). Since VSCode sources the ruby-lsp-activate.sh script to set up its environment, the Ruby LSP needs the ruby and bundler executables to be findable in PATH. This PR resolves the issue by explicitly adding Homebrew's ruby bin directory to PATH after running the setup functions.

Key changes:

  • Add Homebrew's ruby bin directory to PATH by computing it from HOMEBREW_RUBY_PATH
  • Improve documentation with comments explaining zsh compatibility
  • Enhance shellcheck directives for better static analysis

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@cho-m cho-m left a comment

Choose a reason for hiding this comment

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

LGTM.

Not specific to this PR, but may want to see if ensure-bundle-dependencies should be using an absolute path to bundle rather than whatever is on PATH.

@Rylan12 Rylan12 added this pull request to the merge queue Dec 13, 2025
Merged via the queue into main with commit 8b8a0b3 Dec 13, 2025
43 checks passed
@Rylan12 Rylan12 deleted the fix-ruby-lsp-vscode branch December 13, 2025 21:18
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

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.

4 participants