-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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: gopls returns "getting file for Highlight: no PackageHandles" errors #39624
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
Comments
Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here. |
Forgot to mention the gopls version:
|
|
I notice from your bio that you're a Googler. We had an issue that I'd be happy to discuss further internally, but the temporary workaround for this is to set |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. VS Code version:
Version: 1.46.0
Commit: a5d1cc28bb5da32ec67e86cc50f84c67cc690321
Date: 2020-06-10T08:59:06.977Z (6 days ago)
Electron: 7.3.1
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 18.7.0
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
The VS Studio Code Golang language server stops working (all of a sudden). I tried t0 reinstall the vs code app, uninstall the golang extension and install the latest multiple times, without any luck.
What did you expect to see?
It works just like before, can jump to code definitions.
What did you see instead?
This only stops working for my Linux machine, my Mac VS Code works just fine with the latest vs code app and same version of the latest golang extension.
I turned on the debugging of the golang language server and below are the errors I kept seeing (with some detailed go file path replaced with faked ones):
[Trace - 23:25:28.720 PM] Sending request 'textDocument/hover - (9)'.
Params: {"textDocument":{"uri":"file:///usr/local/path/to/my/go/code/example.go"},"position":{"line":32,"character":32}}
[Trace - 23:25:28.721 PM] Sending notification '$/cancelRequest'.
Params: {"id":9}
[Error - Received] 23:25:28.722 PM #9 JSON RPC cancelled
[Trace - 23:25:29.114 PM] Sending request 'textDocument/definition - (10)'.
Params: {"textDocument":{"uri":"file:///usr/local/path/to/my/go/code/example.go"},"position":{"line":32,"character":42}}
[Trace - 23:25:29.167 PM] Sending request 'textDocument/hover - (11)'.
Params: {"textDocument":{"uri":"file:///usr/local/path/to/my/go/code/example.go"},"position":{"line":32,"character":42}}
[Error - Received] 23:25:29.193 PM #10 getting file for Identifier: no PackageHandles
[Error - 11:25:29 PM] Request textDocument/definition failed.
Message: getting file for Identifier: no PackageHandles
Code: 0
[Trace - 23:25:29.194 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/06/16 23:25:29 go/packages.Load\n\tsnapshot=1\n\tdirectory=/usr/local/path/to/my/go/code/example.go\n\tquery=[file=/usr/local/path/to/my/go/code/example.go]\n\tpackages=0\n"}
[Info - 11:25:29 PM] 2020/06/16 23:25:29 go/packages.Load
snapshot=1
directory=/usr/local/path/to/my/go/code
query=[file=/usr/local/path/to/my/go/code/example.go]
packages=0
[Trace - 23:25:29.269 PM] Received response 'textDocument/hover - (11)' in 102ms.
Result: null
[Trace - 23:25:29.269 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/06/16 23:25:29 go/packages.Load\n\tsnapshot=1\n\tdirectory=/usr/local/path/to/my/go/code\n\tquery=[file=/usr/local/path/to/my/go/code/example.go]\n\tpackages=0\n"}
[Info - 11:25:29 PM] 2020/06/16 23:25:29 go/packages.Load
snapshot=1
directory=/usr/local/path/to/my/go/code
query=[file=/usr/local/path/to/my/go/code/example.go]
packages=0
[Trace - 23:25:29.350 PM] Sending request 'textDocument/codeAction - (12)'.
Params: {"textDocument":{"uri":"file://usr/local/path/to/my/go/code/example.go"},"range":{"start":{"line":32,"character":0},"end":{"line":32,"character":76}},"context":{"diagnostics":[{"range":{"start":{"line":32,"character":0},"end":{"line":32,"character":76}},"message":"exported method CloudResourceReconciler.SetupWithManager should have comment or be unexported","severity":2,"source":"go-lint"}],"only":["quickfix"]}}
[Error - Received] 23:25:29.428 PM #12 no PackageHandles
[Error - 11:25:29 PM] Request textDocument/codeAction failed.
Message: no PackageHandles
Code: 0
[Trace - 23:25:29.428 PM] Received notification 'window/logMessage'.
Params: {"type":3,"message":"2020/06/16 23:25:29 go/packages.Load\n\tsnapshot=1\n\tdirectory=/usr/local/path/to/my/go/code\n\tquery=[file=/usr/local/path/to/my/go/code/example.go]\n\tpackages=0\n"}
[Info - 11:25:29 PM] 2020/06/16 23:25:29 go/packages.Load
snapshot=1
directory=/usr/local/path/to/my/go/code
query=[file=/usr/local/path/to/my/go/code/example.go]
packages=0
The text was updated successfully, but these errors were encountered: