Skip to content
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: formatting code with a missing } rewrites function declaration #32698

Closed
dgryski opened this issue Jun 19, 2019 · 3 comments
Closed
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@dgryski
Copy link
Contributor

dgryski commented Jun 19, 2019

Every so often when I'm moving code around, I'll hit save (which formats) but the code I'm working on is incomplete: there's a missing }. Because of this, the function declaration following the one I'm currently working in changes from func (f *foo) Bar(a,b int,c string) error { to (func(f *foo)Bar(a,b,c))(). It looks like because gopls thinks it's still in a function and so tries to make that valid code?.

(I'm running VSCode 1.35.1 with 0.11.0 of the Go plugin. My gopls is from April 2nd, which I'm realizing is a bit out-of-date. I'll update my gopls and close this if I don't see it still happening..)

@gopherbot gopherbot added this to the Unreleased milestone Jun 19, 2019
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Jun 19, 2019
@stamblerre stamblerre changed the title x/tools/cmd/gopls: formatting code with a missing } rewrites function declaration x/tools/gopls: formatting code with a missing } rewrites function declaration Jul 2, 2019
@stamblerre
Copy link
Contributor

Thanks for reporting! I filed #33479, which should hopefully lead to the resolution of this problem.

However, I'm not able to reproduce this in the Go playground: https://play.golang.org/p/_k32CGihMsA. Were you seeing this issue specifically on format or on import organization?

@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 5, 2019
@gopherbot
Copy link

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.)

@dgryski
Copy link
Contributor Author

dgryski commented Sep 5, 2019

I haven't encountered this error again. Will reopen if I see it.

@golang golang locked and limited conversation to collaborators Sep 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. 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