New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/tools/gopls: re-enable upgrade lenses for individual dependencies #42969
Comments
Thanks for the report. @wtask Indeed, I could reproduce this with |
This was indeed a deliberate change (https://golang.org/cl/271297) that we missed in the release notes. |
Thanks for this catch, just updated the release notes to include this. #38339 tracks the way in which we will rework this behavior--we will likely expose a code action that offers an upgrade when you click on the |
Duplicate of #38339 |
@stamblerre Does it mean that gopls v0.5.4 drops any support for per-dependency updates notification? And only Upgrade All option will be available? Painful, unhappy coding. I never saw "Upgrade all dependencies" for my go.mod, what is this? |
As for me, per-dependency update notification is very useful feature of vscode-go, and now it is absent. So I have to stay on gopls v0.5.3 |
I also miss this feature heavily, the "upgrade all dependencies" at the top of the file is not very helpful, because this wont work for most of the projects which depend on k8s.io/*. So would be very nice if at least the old behavior could be enabled on will again. |
@majst01 I found only this helper https://github.com/psampaz/go-mod-outdated to replace missed feature, but it's inconvenient. |
@majst01: Do you mind explaining why that is? #38339 tracks our work in replacing this feature--we will be adding an "Update direct dependencies" code lens in the next release. |
@stamblerre of course. If you have a project which relies on some kubernetes dependencies, updating all dependencies for various reasons. The most obvious is that k8s.io/client-go must follow the other k8s.io dependencies like k8s.io/apimachinery, but the most recent version of client-go is v11.x which is based on an older versioning scheme back then. In reality the actual version is v0.19.4. With this situation alone it is not possible anymore to update any dependencies from vscode, because client-go v11.x is not compatible with k8s.io/apimachinery v0.19.x. The update all dependencies action will not succeed, and you have to update every dependency by hand. I am sure lot of developers have the same problem i describe here. One example from of our projects is the cloud controller manager for metal-stack.io |
@stamblerre thanks ! |
Here I thought this was a bug with the latest version of Gopls. Myself and a number of my colleagues really liked the ability to click and update the various go.mod entries. Add my name to the list of people who want this feature re-enabled. |
gopls v0.6.0 with "Upgrade direct dependencies" doesn't work. Got git errors. But running the first problematic command from error popup directly in console works as expected |
I would be happy to help investigate what went wrong here if you would like to share the errors. Please note, you can always update your dependencies on the command line by running As I have noted previously, the granular updates posed performance concerns, and many users found them distracting (especially if they did not want to upgrade). We are revisiting this UX and will likely bring back the feature in a different form. Until then, best path forward would be to upgrade individual dependencies using the command-line. |
If user do not want to upgrade, why to click an update link? Note, I just really do not understand why cool feature is removed and replaces by strange, blind functionality? Also, if I have to updrade all I will run |
Change https://golang.org/cl/286474 mentions this issue: |
In CL 271297, I disabled the constantly-running upgrade check, which removed the upgrade commands for individual dependencies. This seems to have been a relatively popular feature. Re-introduce it, but requiring explicit user interaction. We now run an upgrade check when the user clicks "Check for upgrades". Those results are stored on the View and used to show diagnostics on any requires they apply to. Right now we only check the go.mod the user has open; in multi-module workspaces it might make sense to check all of them, but I'm not sure. Fixes golang/go#42969. Change-Id: I65205dc99a4fa9daafdb83145b0294b6f3be5336 Reviewed-on: https://go-review.googlesource.com/c/tools/+/286474 Trust: Heschi Kreinick <heschi@google.com> Run-TryBot: Heschi Kreinick <heschi@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
What version of Go, VS Code & VS Code Go extension are you using?
go version
to get version of Gogopls -v version
to get version of Gopls if you are using the language server.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiderse5a624b788d92b8d34d1392e4c4d9789406efe8f
x64
go env
to get the go development environment detailsset GO111MODULE=on
set GOARCH=amd64
set GOBIN=c:\dev\go\bin
set GOCACHE=C:\Users\webta\AppData\Local\go-build
set GOENV=C:\Users\webta\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\dev\go\pkg\mod
set GONOPROXY=gitlab.XXX
set GONOSUMDB=gitlab.XXX
set GOOS=windows
set GOPATH=C:\dev\go
set GOPRIVATE=gitlab.XXX
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\webta\AppData\Local\Temp\go-build547893570=/tmp/go-build -gno-record-gcc-switches
Describe the bug
So bug description is in the title for this issue.
Steps to reproduce the behavior:
go get golang.org/x/tools/gopls@v0.5.3
and restart vscodeThe text was updated successfully, but these errors were encountered: