launch/vscode: prefer known vs code paths over code on PATH (#15073)

This commit is contained in:
Eva H
2026-03-26 15:06:28 -07:00
committed by GitHub
parent 4a2b9f9dbc
commit 1adfc27f04

View File

@@ -25,11 +25,8 @@ type VSCode struct{}
func (v *VSCode) String() string { return "Visual Studio Code" }
// findBinary returns the path/command to launch VS Code, or "" if not found.
// It checks for the "code" CLI on PATH first, then falls back to platform-specific locations.
// It checks platform-specific locations only.
func (v *VSCode) findBinary() string {
if _, err := exec.LookPath("code"); err == nil {
return "code"
}
var candidates []string
switch runtime.GOOS {
case "darwin":