x/tools/gopls: formatting on save inserts an unnecessary package clause #38412
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
When using with VS Code
settings
gopls version 0.4.0
go1.14, darwin/amd64
VS Code Go extension 0.14.0-beta.6
go extension setting:
"go.useLanguageServer": true,
how to repro:
$ cat main.go
package main
func main() { }
Open the it from the code, and save the file again (command+s). That triggers text edit like:
Attached the gopls log. code.log
File save was requested after the message 7.
So, message 8 is the one triggered by my action.
Note: when triggering the formatting using "Format Document" (e.g. right click -> "Format Document") the formatting works as expected.
The text was updated successfully, but these errors were encountered: