x/tools/gopls: textDocument/implementation is slow #58653
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
gopls/incremental
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
gopls version
gopls built @ 3ec30bd
go version -m ~/go/bin/gopls
``` go version -m ~/go/bin/gopls /Users/hakim/go/bin/gopls: go1.20.1 path golang.org/x/tools/gopls mod golang.org/x/tools/gopls (devel) dep github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak= dep github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= dep github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= dep golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA= dep golang.org/x/exp/typeparams v0.0.0-20221212164502-fae10dda9338 h1:2O2DON6y3XMJiQRAS1UWU+54aec2uopH3x7MAiqGW6Y= dep golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= dep golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= dep golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= dep golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= dep golang.org/x/tools (devel) dep golang.org/x/vuln v0.0.0-20230110180137-6ad3e3d07815 h1:A9kONVi4+AnuOr1dopsibH6hLi1Huy54cbeJxnq4vmU= dep honnef.co/go/tools v0.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA= dep mvdan.cc/gofumpt v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM= dep mvdan.cc/xurls/v2 v2.4.0 h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc= build vcs.revision=3ec30bd95cd143796a8b51514c85d5667d261333 build vcs.time=2023-02-22T21:51:18Z ```go env
go1.20.1
darwin/amd64
What did you do?
git clone https://github.com/juju/juju
cd juju
And open vscode from the directory.
Open utils/stringforwarder/stringforwarder.go
Hover over StringForwarder type def (line13), right click, choose "Find All Implementations"
This triggers
textDocument/implementation
LSP requestWhat did you expect to see?
Fast response or failure.
What did you see instead?
gopls becomes unresponsive for 10+min.
Unfortunately, I couldn't find VS Code UI that causes cancellation of the implementation request.
(so this isn't cancellable currently).
While the gopls server is blocked handling this request, none of the other requests can be served.
Once the first implementation response returns (after 10min+), gopls responds fast.
But if I restart gopls, I see the initial loading time is much shorter, but the implementation query still takes several minutes and blocks other gopls functionalities.
Another strange behavior is the log messages about go command failures related to module download. I thought gopls would do module download when starting and warm the module cache. So the "module lookup disabled by GOPROXY=off" errors message is rather surprising and I wonder whether gopls managed to diagnose go.mod.
Editor and settings
VS Code
Logs
The text was updated successfully, but these errors were encountered: