x/tools/gopls: returns with non-0 exit code on server restart / shutdown #40832
Labels
FrozenDueToAge
gopls
Issues related to the Go language server, gopls.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
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?
Go: Restart Language Server
from the command paletteWhat did you expect to see?
In the go server logs, there should be no:
message
What did you see instead?
I see the aforementioned message in the logs and the server is exiting with exit code 2.
I think the relevant code is here:
https://github.com/golang/tools/blob/cc40288be83943c50bf80a9702fb35bd5e580e8d/internal/jsonrpc2/stream.go#L110-L114
And the problem might be that it's not doing what the comment there says. The comment says:
but since the
s.in.ReadString('\n')
call is looking for a newline, I think it will return non-nilerr
when it sees an empty line. Thus we'll never get to the graceful, empty-line handling lower in the code.The text was updated successfully, but these errors were encountered: