Ask questionsx/tools/gopls: format feature doesn't follow `goimports`

For example, here is what imports block looks like in VS Code after pressing Alt-Shift-F (formatting) with enabled gopls: изображение

And here is what it looks like after pressing Ctrl-S (forcefully save file): изображение

For p.2, these options are enabled for gopls:

        "editor.formatOnSave": true,
        "editor.codeActionsOnSave": {
            "source.organizeImports": true

I'd like to have an ability to configure gopls to follow goimports style when formatting the file or to have this behavior as default.

Related: If I remove fmt dependency from code, but leave it in imports section, formatting will not remove fmt: изображение


Answer questions inliquid

Maybe let others say their word instead of just closing all my issues? I believe you are very wrong with that approach. At least it's non-professional.

There was a setting both in Sourcegraph's go-langserver and in bingo. There is setting in VS Code which allows to select gofmt or goimports for formatting. Most of the gophers I know use goimports-like for formatting in VS Code and Goland (last one is on a cosmic distance in all that, which makes use of gopls ridiculous).


Related questions

cmd/link: segmentation fault during mach-o linking hot 6
cmd/vet: potential false positive in the "suspect or" check hot 3
cmd/go: cannot find module providing package error stops `go get` processing hot 3
vendor/ undefined: errors.Frame ... hot 2
cmd/cgo error: runtime: unknown pc 0x7fff5c805b86 hot 2
internal/poll: transparently support new linux io_uring interface hot 2
Plis fixit! Its not good!!! hot 2
cmd/go: needs a better error than "missing dot in first path element" when GOROOT is set incorrectly hot 2
x/mobile: gomobile bind is failing with latest version [+cafc553] of gomobile hot 2
cmd/go: "found, but does not contain package" error refers to replaced version instead of its replacement hot 2
x/xerrors: fails to compile on tip hot 1
cmd/go: `go clean <package>` downloads modules hot 1
runtime: crash with "invalid pc-encoded table" hot 1
cmd/link: showing many ld warnings of "building for macOS, but linking in object file" hot 1
runtime: go program crach, it seems fall into infinite loop hot 1
Github User Rank List