vscode-go icon indicating copy to clipboard operation
vscode-go copied to clipboard

Improve the version suggestion

Open ansidev opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. I installed Go 1.18.1, 1.18, 1.17 in the system and 1.18.1 is the default version. I added the Go environment path for 2 Go versions to the VS Code Go extension.

  • Open a Go project (I opened in VS Code and set Go version to 1.17 before).
  • VS Code suggested me to download newer Go version 1.18.1 (minor update and the latest version) and 1.17.9 (path update) compared to the current configured Go version (1.17).

Describe alternatives you've considered

  • The extension suggestions should be smarter.
  • If the suggested version exists in the local environment, suggest the developer switch to that version instead of going to the download website.

ansidev avatar Apr 15 '22 08:04 ansidev

@ansidev There are many different ways of installing Go (different package managers, go's dl.go.dev, custom locations, ...). Do you have any specific idea on how the extension should find the location of the local version without excessive disk scanning and invoking arbitrary binaries to check the version?

hyangah avatar Apr 15 '22 12:04 hyangah

@hyangah

This is my current list of Go Environment Screen Shot 2022-04-15 at 20 31 40

If the suggested version exists in the local environment, suggest the developer switch to that version instead of going to the download website.

I think at this time, we should resolve this issue. (Open a Go project with Go Environment 1.17 and VS Code Go suggests updating Go to 1.18.1, but it exists in the Go Environment list. The better behaviour should be switching to the Go Environment 1.18.1.

There are many different ways of installing Go (different package managers, go's dl.go.dev, custom locations, ...). Do you have any specific idea on how the extension should find the location of the local version without excessive disk scanning and invoking arbitrary binaries to check the version?

To me, the strategy should be:

  • Sort ways of installing Go by its popularity.
  • Implement the solution to solve the problem case by case and improve it if there is an issue.

IMO, installing Go using brew is the most popular way among developers, I also use this way because of its convenience, so if possible, please implement the solution for this way first :)

ansidev avatar Apr 15 '22 13:04 ansidev