Skip to content

Commit

Permalink
chore(cli): add displayName to VSCode flavor for clearer log output
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalbreuninger committed Jan 10, 2025
1 parent 7a52e3e commit 8e5ace8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/agent/container/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ func (cmd *SetupContainerCmd) installIDE(setupInfo *config.Result, ide *provider
}

func (cmd *SetupContainerCmd) setupVSCode(setupInfo *config.Result, ideOptions map[string]config2.OptionValue, flavor vscode.Flavor, log log.Logger) error {
log.Debugf("Setup %s...", flavor)
log.Debugf("Setup %s...", flavor.DisplayName())
vsCodeConfiguration := config.GetVSCodeConfiguration(setupInfo.MergedConfig)
settings := ""
if len(vsCodeConfiguration.Settings) > 0 {
Expand Down
6 changes: 5 additions & 1 deletion pkg/ide/vscode/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ import (
)

func Open(ctx context.Context, workspace, folder string, newWindow bool, flavor Flavor, log log.Logger) error {
log.Infof("Starting %s...", flavor)
log.Infof("Starting %s...", flavor.DisplayName())
cliErr := openViaCLI(ctx, workspace, folder, newWindow, flavor, log)
if cliErr == nil {
return nil
}

browserErr := openViaBrowser(workspace, folder, newWindow, flavor, log)
if browserErr == nil {
return nil
}

return errors.Join(cliErr, browserErr)
}

Expand Down
17 changes: 17 additions & 0 deletions pkg/ide/vscode/vscode.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,23 @@ const (
FlavorCodium Flavor = "codium"
)

func (f Flavor) DisplayName() string {
switch f {
case FlavorStable:
return "VSCode"
case FlavorInsiders:
return "VSCode Insiders"
case FlavorCursor:
return "Cursor"
case FlavorPositron:
return "positron"
case FlavorCodium:
return "VSCodium"
default:
return "VSCode"
}
}

var Options = ide.Options{
OpenNewWindow: {
Name: OpenNewWindow,
Expand Down

0 comments on commit 8e5ace8

Please sign in to comment.