-
Notifications
You must be signed in to change notification settings - Fork 769
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
Command 'gopls.package_symbols' failed: Error: no package metadata for file {filename} #3681
Comments
I had the same problem. |
Yeah I had to leave the pre-release due this error. |
Thanks for reporting this. The go extension should not trigger any package_symbol command against non-go file. This is a mistake. Let me fix it and release v0.45.2 to make the pre-release version healthy. |
It also needs to filter out non- |
Hi jakebailey, Thanks for the reminder. You are correct, I will also add a condition for checking I was able to re-produce this with |
Change https://go.dev/cl/649257 mentions this issue: |
Change https://go.dev/cl/649258 mentions this issue: |
As reported in golang/vscode-go#3681, spurious errors from gopls.package_symbols can cause very distracting popups in VS Code. For now, err on the side of silence. In the future, we may want to revisit this behavior. For golang/vscode-go#3681 Change-Id: I67f8b8e1e299ef88dabbb284a151aada131652f8 Reviewed-on: https://go-review.googlesource.com/c/tools/+/649257 Reviewed-by: Hongxiang Jiang <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
Skip vscode message for package symbol command due to high frequency. For #3681 Change-Id: If4e0749d7123d17292a9f7266e73c65c8bde332c Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/649258 Reviewed-by: Robert Findley <[email protected]> Auto-Submit: Hongxiang Jiang <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> kokoro-CI: kokoro <[email protected]>
The fix is released in vscode-go insider version v0.45.2. Also a change in |
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.-go1.23.6 darwin/arm64
gopls -v version
to get version of Gopls from the VS Code integrated terminal.code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Go: Locate Configured Go Tools
command.Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.Describe the bug
After Release v0.45.1, every time I save a non
.go
file in my project (for example, a.json
orMakefile
) I receive the errorCommand 'gopls.package_symbols' failed: Error: no package metadata for file {filename}
Steps to reproduce the behavior:
.go
file (for example a .json) inside a Go project.Screenshots or recordings
The text was updated successfully, but these errors were encountered: