Skip to content

gopls: automated issue report (initialization) #1314

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

Closed
keenangebze opened this issue Mar 12, 2021 · 3 comments
Closed

gopls: automated issue report (initialization) #1314

keenangebze opened this issue Mar 12, 2021 · 3 comments
Labels
automatedReport Automatically created issues FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@keenangebze
Copy link

gopls version: v0.6.4
gopls flags:
extension version: 0.23.1
environment: Visual Studio Code linux
initialization error: Error: JSON RPC parse error: json: cannot unmarshal number into Go struct field RenameClientCapabilities.prepareSupportDefaultBehavior of type bool: JSON RPC parse error
manual restart count: 0
total start count: 1

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

Just updated gopls.

I'm initiating the workspace inside GVM

gvm use go1.12.4
cd $GOPATH/src/github.com/company/
code repo

repo is a link to:

ls -lah
lrwxrwxrwx  1 user group   43 Feb 15 14:24 repo -> /home/user/go/src/github.com/company/repo

When opening vscode got this alert:

The gopls server failed to initialize Would you like to report a gopls issue on GitHub?
You will be asked to provide additional information and logs, so PLEASE READ THE CONTENT IN YOUR BROWSER.

It seems it only error when I used go1.12.4 in gvm, when I tried go1.14.4 it does not get the alert.
I update the gopls when opening workspace on go1.14.4

Starting client failed
  Message: JSON RPC parse error: json: cannot unmarshal number into Go struct field RenameClientCapabilities.prepareSupportDefaultBehavior of type bool: JSON RPC parse error
  Code: -32700 

OPTIONAL: If you would like to share more information, you can attach your complete gopls logs.

NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE.
DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.

[Error - 10:27:40 AM] Starting client failed
  Message: JSON RPC parse error: json: cannot unmarshal number into Go struct field RenameClientCapabilities.prepareSupportDefaultBehavior of type bool: JSON RPC parse error
  Code: -32700 
gopls: failed reading header line: &{%!w(string=EOF)}
@hyangah
Copy link
Contributor

hyangah commented Mar 12, 2021

Thanks for the detailed info. @keenangebze

The root cause of the original issue is #1300.
You will need a recent version of gopls (v0.6.6). It's possible that when you were using go1.12.4, an older version of gopls (v0.6.4) was picked up by gvm. Please update gopls.

BTW, go1.12 is a no longer supported go version in go project and (gopls still may compile, but there is no guarantee). Is there any reason you need to work with go1.12.4?

@hyangah hyangah added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 12, 2021
@keenangebze
Copy link
Author

Thanks for the link @hyangah, solved the issue as instructed in #1300

gvm use go1.12.4
cd $GOPATH/src/github.com/company
GO111MODULE=on go get golang.org/x/tools/gopls@latest
code repo

We have both old and new repository that uses multiple version of golang.
I guess updating the go version for the old repository takes additional effort for the team (moving from dep to go mod).
I'll keep that in mind and raise it to my team, thank you

@hyangah
Copy link
Contributor

hyangah commented Mar 12, 2021

Thanks. I will close this issue. I hope we can address #1300 soon.

@hyangah hyangah closed this as completed Mar 12, 2021
@hyangah hyangah added the automatedReport Automatically created issues label Mar 13, 2021
@golang golang locked and limited conversation to collaborators Mar 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automatedReport Automatically created issues FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants