-
Notifications
You must be signed in to change notification settings - Fork 18k
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: undeclared name error in package with multiple files #41965
Comments
@dieseldesai: Can you please share the output of |
The problem seems to have disappeared overnight. The only change was I had to reconnect to the remote SSH session and I assume the language server had to restart when the vscode window was reloaded. Would the output of that command still be useful right now? |
If the issue is no longer happening, then we can go ahead and close this. |
Ok, I'll reopen this issue if the problem recurs |
The problem came back today. Here's the result of running the rpc.trace command on the file:
|
Thanks for sharing that. Looks like there's nothing wrong the packages in your directory--it's likely that some edit you are making is causing the problems. Are you able to share a full (possibly redacted) log from an editor session? |
Here's a log from a recent session
|
Duplicate of #37205 |
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?
I'm using VSCode with a remote server. When opening a file, everything is ok. After typing some code and saving, the language server does some stuff and comes back with a bunch of undeclared name errors for types declared in the same package but in different files. The code still compiles fine using go build
I noticed the following log lines in gopls server (directory paths elided):
From previous issues, it seems like the second log message is the issue because of "command-line-arguments"
This is a single module repository and I've tried Add Folder to Workspace on the root dir (that contains go.mod)
What did you expect to see?
No undeclared name errors
What did you see instead?
Many undeclared name errors
The text was updated successfully, but these errors were encountered: