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

Open
dgryski opened this issue Jun 19, 2019 · 0 comments

Comments

Projects
None yet
2 participants
@dgryski
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.