x/tools/gopls: requests fail with type errors #36249
Closed
Labels
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. |
Currently you have a syntax error which gopls is reporting: Only func/var/type/const declarations are valid at the file level. gopls in general does not work well when faced with syntax errors. |
Completions don't work at the top level of the file. Try completing inside a function. |
Thanks! I was a misunderstanding gopls working. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Run Vscode with the latest vscode-go extension and gopls language server on.
I opened random go file, gopls logs:
And autosuggest is broken too.

Similar Case#31492
I create .code-workspace file, but still does not work.
What did you expect to see?
gopls works with vscode.
What did you see instead?
Request textDocument/* failed.
The text was updated successfully, but these errors were encountered: