x/tools/gopls: formatting code with a missing } rewrites function declaration #32698
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
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 fromfunc (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..)
The text was updated successfully, but these errors were encountered: