Skip to content

improve GOTOOLCHAIN switch experience #3032

@hyangah

Description

@hyangah

Inspired by golang/go#63922

When the target toolchain version can't be downloaded, currently, the VS Code Go extension fails hard. It will be nice if the extension fails gracefully and guides the user to successfully address the issue.
Screenshot 2023-11-03 at 1 31 52 PM

Issues

  • Better logging - the extension runs go version and go env commands during activation. The error messages logged in the Go output channels are the result of these command runs, but revealed out of context. That results in confusion. Log why extension runs the command, and what exact command it runs. And, if possible, how to fix them.
  • Missing Go status bar - the activation failed before registering the status bar, so the go status bar didn't appear. Instead, the extension should continue registering the status bar and make the problem visible (changing color or showing error icon).
  • Incomplete command registration - since activation couldn't complete, most commands weren't registered. However, they appear in the Command Palette. VS Code allows conditional activation of commands and ui components. Utilize it. And some commands (e.g. restart language server or reactive) may be useful when user fixes the issue and recover.
  • Gopls not started - I think we can continue to start gopls so helpful error messages are coming from gopls.
  • Update the Go status bar version when the toolchain version in use is changed.

cc @golang/tools-team

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions