Skip to content

Conversation

@Rylan12
Copy link
Member

@Rylan12 Rylan12 commented Nov 17, 2025

Testing out creating a multi-root workspace for vscode

To test this out, run code $(brew --repo)/homebrew.code-workspace

The good news is that it seems to work fine for the brew repo.
For formulae and casks, command-click to view definition of formula DSLs seems to work fine, but the sorbet requirement still stands which is unfortunate.

Also, when opening a formula or cask, I get this weird error:

Automatic Ruby environment activation with custom failed: spawn /opt/homebrew/bin/zsh ENOENT

Which is odd because that path does exist, and seems to work fine for files in brew, just not in core or cask...

Copilot AI review requested due to automatic review settings November 17, 2025 03:15
Copilot finished reviewing on behalf of Rylan12 November 17, 2025 03:17
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 adds a multi-root VS Code workspace configuration file (homebrew.code-workspace) that enables users to work with the main Homebrew repository alongside homebrew-core and homebrew-cask in a single VS Code window. The workspace file consolidates development settings for Ruby LSP, Sorbet, and shell formatting across all three repositories.

Key Changes

  • Created a multi-root workspace configuration with three folders: the main brew repo, homebrew-core, and homebrew-cask
  • Configured unified development settings for Ruby LSP, Sorbet type checking, shell formatting, and test coverage
  • Updated .gitignore to explicitly include the new workspace file

Reviewed Changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 4 comments.

File Description
homebrew.code-workspace New multi-root workspace configuration that consolidates development settings for the brew repository and its core/cask taps
.gitignore Added unignore rule for the new workspace file to ensure it's tracked in version control

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

Comment on lines +5 to +53
"name": "brew"
},
{
"path": "Library/Taps/homebrew/homebrew-core",
"name": "homebrew-core"
},
{
"path": "Library/Taps/homebrew/homebrew-cask",
"name": "homebrew-cask"
}
],
"settings": {
"files.exclude": {
"Library/Taps": true,
// Exclude all files in bin except for brew
"bin/[^b]*": true,
"bin/b[^r]*": true,
"bin/br[^e]*": true,
"bin/bre[^w]*": true,
// brew aliases are in the form brew-*
"bin/brew-*": true,
},
"rubyLsp.rubyVersionManager": {
"identifier": "custom"
},
"rubyLsp.customRubyCommand": "source /opt/homebrew/.vscode/ruby-lsp-activate.sh",
"rubyLsp.bundleGemfile": "Library/Homebrew/Gemfile",
"rubyLsp.formatter": "rubocop",
"sorbet.enabled": true,
"sorbet.lspConfigs": [
{
"id": "default",
"name": "Brew Typecheck",
"description": "Default configuration",
"command": [
"./bin/brew",
"typecheck",
"--lsp"
]
}
],
"sorbet.selectedLspConfigId": "default",
"shellformat.effectLanguages": [
"shellscript"
],
"shellformat.path": "${workspaceFolder}/Library/Homebrew/utils/shfmt.sh",
"shellformat.flag": "-i 2 -ci -ln bash",
"simplecov-vscode.path": "Library/Homebrew/test/coverage/.resultset.json",
"simplecov-vscode.enabled": false,
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

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

Inconsistent indentation: this file primarily uses tabs for indentation (as seen throughout), but lines 5, 9, 13, 17-18, 25, and 53 use spaces. For consistency with the rest of the file, these lines should use tabs.

Copilot uses AI. Check for mistakes.
"rubyLsp.rubyVersionManager": {
"identifier": "custom"
},
"rubyLsp.customRubyCommand": "source /opt/homebrew/.vscode/ruby-lsp-activate.sh",
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

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

Hardcoded absolute path /opt/homebrew/.vscode/ruby-lsp-activate.sh will fail for users who don't have Homebrew installed in /opt/homebrew (e.g., Linux users or Intel Mac users with /usr/local). The existing .vscode/settings.json uses a relative path source ../../.vscode/ruby-lsp-activate.sh which is more portable. Consider using a similar relative path or ${workspaceFolder}/.vscode/ruby-lsp-activate.sh.

Suggested change
"rubyLsp.customRubyCommand": "source /opt/homebrew/.vscode/ruby-lsp-activate.sh",
"rubyLsp.customRubyCommand": "source ${workspaceFolder}/.vscode/ruby-lsp-activate.sh",

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

Worth noting: this needs to be an absolute path because it's executed relative to each individual folder, so the ../../ won't be correct for the taps

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.

Good to me when working for you!

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.

3 participants