Skip to content

x/tools/gopls: analysis key is ignored in neovim/lspconfig #75668

@OneOfOne

Description

@OneOfOne

Go version

go version go1.25.1 linux/amd64
golang.org/x/tools/gopls v0.20.0

Output of go env in your module/workspace:

AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v4'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN='/home/oneofone/code/go/bin'
GOCACHE='/home/oneofone/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/oneofone/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1869883985=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/dev/null'
GOMODCACHE='/home/oneofone/code/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/oneofone/code/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/lib/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/oneofone/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/lib/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.25.1'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

Added golsp to lspconfig settings with this:

	{
		'neovim/nvim-lspconfig',
		opts = {
			servers = {
				gopls = {
					settings = {
						gopls = {
							completeFunctionCalls = false,
							usePlaceholders = false,
							analyses = {
								fieldalignment = true,
								fillreturns = false,
							},
						},
					},
				},
			},
		},
	},

What did you see happen?

Analysis settings are completely ignored.

What did you expect to see?

Analyses settings to be honored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ToolsThis label describes issues relating to any tools in the x/tools repository.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions