mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Add sorbet vscode configuration
This commit is contained in:
parent
b26bf95288
commit
6badcd929c
15
.vscode/settings.json
vendored
15
.vscode/settings.json
vendored
@ -18,6 +18,21 @@
|
||||
"editor.formatOnType": true,
|
||||
"editor.semanticHighlighting.enabled": true,
|
||||
},
|
||||
"sorbet.enabled": true,
|
||||
"sorbet.lspConfigs": [
|
||||
{
|
||||
"id": "default",
|
||||
"name": "Brew Typecheck",
|
||||
"description": "Default configuration",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"command": [
|
||||
"./bin/brew",
|
||||
"typecheck",
|
||||
"--lsp",
|
||||
]
|
||||
}
|
||||
],
|
||||
"sorbet.selectedLspConfigId": "default",
|
||||
"shellcheck.customArgs": [
|
||||
"--shell=bash",
|
||||
"--enable=all",
|
||||
|
@ -24,6 +24,8 @@ module Homebrew
|
||||
switch "--suggest-typed",
|
||||
depends_on: "--update",
|
||||
description: "Try upgrading `typed` sigils."
|
||||
switch "--lsp",
|
||||
description: "Start the Sorbet LSP server."
|
||||
flag "--dir=",
|
||||
description: "Typecheck all files in a specific directory."
|
||||
flag "--file=",
|
||||
@ -33,6 +35,9 @@ module Homebrew
|
||||
"in their paths (relative to the input path passed to Sorbet)."
|
||||
|
||||
conflicts "--dir", "--file"
|
||||
conflicts "--lsp", "--update"
|
||||
conflicts "--lsp", "--update-all"
|
||||
conflicts "--lsp", "--fix"
|
||||
|
||||
named_args :none
|
||||
end
|
||||
@ -80,6 +85,15 @@ module Homebrew
|
||||
srb_exec << "--autocorrect"
|
||||
end
|
||||
|
||||
if args.lsp?
|
||||
srb_exec << "--lsp"
|
||||
if (watchman = which("watchman", ORIGINAL_PATHS))
|
||||
srb_exec << "--watchman-path" << watchman
|
||||
else
|
||||
srb_exec << "--disable-watchman" unless which("watchman", ORIGINAL_PATHS)
|
||||
end
|
||||
end
|
||||
|
||||
srb_exec += ["--ignore", args.ignore] if args.ignore.present?
|
||||
if args.file.present? || args.dir.present?
|
||||
cd("sorbet") do
|
||||
|
Loading…
x
Reference in New Issue
Block a user