-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: 0.4.4 undeclared name errors on valid code #40553
Comments
I'm also having issues with gopls after upgrading to 0.4.4 today. |
@andig: Please follow the troubleshooting instructions at https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md to capture logs, upload them here, and we'll take a look. @rsikdar please do the same, but file a new issue rather than adding to this one. Similar symptoms can have different causes and it's better to keep them separate for now. |
gopls 0.4.4 consumes tons of memory! |
@apang1992 Please follow the instructions above and file a new issue and we'll take a look. |
Here's the gopls server log- not much so see https://pastebin.com/tEQwYS3p. Is this what is required? |
gopls 0.4.4 consumes tons of memory! |
@404CN as written above, please open a separate issue |
@heschik while waiting, is there any way to force a downgrade of gopls and tools to get back to a working state? |
I'm having similar issues. I noticed in the 0.4.4 release notes:
But I am specifically opening a few packages (vs-code with add-folder-to-workspace) instead of my entire module because my entire module is rather large with a large number of packages. Is there an option to get the old behavior? |
@andig instructions to install a specific version are on https://github.com/golang/tools/blob/master/gopls/doc/user.md#installation. You have an interesting workspace setup and I wonder if it's deliberate. From what I can tell there are two folders, |
That's coincidence. All my projects reside in htdocs. My workspace typicially contains a bunch of project root folders, each one with its own go mod. I've removed the stray folder and excess go.mod. I've downgraded to 0.15.2 and 0.4.3 and upgraded again. Now I've started getting this message:
Didn't have any problems before gopls 0.4.4 |
Have you added each module to your workspace through View -> Add Folder to Workspace? Currently, |
@rsikdar, @apang1992, @404CN, @jrwren: Please file new issues so that we can discuss them separately. While the error messages may be the same, the cause of the issues are likely to be different. |
Yes. I have meanwhile downgraded and upgraded again, both vscode extension and gopls. At this time, I'm not seeing errors anymore. One observation I've had is that vscode showed various errors and type hints that indicated it was working from an entirely outdated codebase (eg. old types that don't exist anymore shown in the hints, new types declared unknown). Is there any type of cache in gopls that could be cleared? |
You can try the "Go: Restart Language Server" command in VS Code to restart the language server. Do you mind providing an updated log after you deleted the stray |
Not at all, thank you for the intensive care. Here's an updated log: https://pastebin.com/U7yR8C2W. I'm still (or again) seeing problems for things that compile fine:
Update not sure this one should compile, it doesn't on the command line either although that package most definitely exists, so not sure if there still is a gopls issue:
|
The error message looks like you're in GOPATH mode, but I believe you're using modules. Make sure that |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Upgrade gopls when prompted by vscode
What did you expect to see?
Smooth coding as before
What did you see instead?
Lots of
undeclared name: xyz
errors in vscode and generally high CPU usage when using the go plugin. The code itself is fine and compiles on the command line.Raising here as this happened immediately after upgrading gopls from 0.4.3 to 0.4.4. Tools have been reinstalled.
The text was updated successfully, but these errors were encountered: