-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add homebrew.code-workspace file
#21096
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
.gitignoreto 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.
| "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, |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
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.
| "rubyLsp.rubyVersionManager": { | ||
| "identifier": "custom" | ||
| }, | ||
| "rubyLsp.customRubyCommand": "source /opt/homebrew/.vscode/ruby-lsp-activate.sh", |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
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.
| "rubyLsp.customRubyCommand": "source /opt/homebrew/.vscode/ruby-lsp-activate.sh", | |
| "rubyLsp.customRubyCommand": "source ${workspaceFolder}/.vscode/ruby-lsp-activate.sh", |
There was a problem hiding this comment.
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
MikeMcQuaid
left a comment
There was a problem hiding this 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!
Testing out creating a multi-root workspace for vscode
To test this out, run
code $(brew --repo)/homebrew.code-workspaceThe good news is that it seems to work fine for the
brewrepo.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:
Which is odd because that path does exist, and seems to work fine for files in
brew, just not in core or cask...