Skip to content

fix(tools): make version optional and improve error reporting for install-vscode#559

Merged
ChronosMasterOfAllTime merged 1 commit into
mainfrom
fix/vscode/install
Jun 3, 2026
Merged

fix(tools): make version optional and improve error reporting for install-vscode#559
ChronosMasterOfAllTime merged 1 commit into
mainfrom
fix/vscode/install

Conversation

@ChronosMasterOfAllTime

Copy link
Copy Markdown
Contributor

Summary

Improves the goenv tools install-vscode command by making the version argument optional and enhancing error reporting during tool installation.

Changes

User Experience Improvements

  • Optional version argument: Now defaults to the current Go version when not specified
    • Before: goenv tools install-vscode <version> (required)
    • After: goenv tools install-vscode [version] (optional)
  • Auto-detection: Automatically uses GetCurrentVersionResolved() to handle partial versions
  • Better examples: Reorganized help text to show the most common use case first

Error Reporting Enhancements

  • Stderr capture: Captures and displays error output from failed tool installations
  • First error context: Preserves the first error encountered for better debugging
  • Mode-aware output: Respects verbose/non-verbose mode settings
    • Verbose: Shows all output in real-time
    • Non-verbose: Shows clean status with detailed errors only on failure

Bug Fixes

  • Fixed gotests package path: Corrected from github.com/cweill/gotests to github.com/cweill/gotests/gotests

Testing

Manually tested:

  • ✅ Installation with explicit version: goenv tools install-vscode 1.25.2
  • ✅ Installation with current version: goenv tools install-vscode
  • ✅ Error handling when no version is set
  • ✅ Error reporting for failed tool installations
  • ✅ Verbose and non-verbose output modes

Example Usage

# Install VSCode tools for current version (new!)
goenv tools install-vscode

# Install VSCode tools for specific version
goenv tools install-vscode 1.25.2

# Show what would be installed
goenv tools install-vscode --dry-run

Related Issues

This PR improves the usability of the VS Code integration by reducing friction in the most common use case (installing tools for the current version).

…tall-vscode

- Make version argument optional, defaulting to current Go version
- Add auto-detection of current version using GetCurrentVersionResolved
- Improve error reporting with stderr capture and detailed messages
- Fix gotests package path (github.com/cweill/gotests/gotests)
- Capture and display first error for better debugging
- Update help text and examples to show new default behavior
- Add proper verbose/non-verbose mode output handling
@ChronosMasterOfAllTime ChronosMasterOfAllTime merged commit ea61d60 into main Jun 3, 2026
11 checks passed
@ChronosMasterOfAllTime ChronosMasterOfAllTime deleted the fix/vscode/install branch June 3, 2026 15:15
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.

1 participant