Skip to content

x/tools/gopls: document Change Signature refactoring (rename on func token) #76343

@IlyasYOY

Description

@IlyasYOY

What version of Go are you using (go version)?

$ go version
go version go1.25.4 darwin/arm64
$ gopls version
golang.org/x/tools/gopls v0.20.0

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
AR='ar'
CC='cc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='c++'
GCCGO='gccgo'
GO111MODULE='on'
GOARCH='arm64'
GOARM64='v8.0'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/Users/ilyasyoy/Library/Caches/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/Users/ilyasyoy/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/f2/s841xw414zqfscfkvn76cfv40000gn/T/go-build258738511=/tmp/go-build -gno-record-gcc-switches -fno-common'
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMOD='/Users/ilyasyoy/Projects/IlyasYOY/golangci-lint/go.mod'
GOMODCACHE='/Users/ilyasyoy/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/ilyasyoy/go'
GOPRIVATE=''
GOPROXY='direct'
GOROOT='/opt/homebrew/Cellar/go/1.25.4/libexec'
GOSUMDB='off'
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/ilyasyoy/Library/Application Support/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.25.4/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.25.4'
GOWORK=''
PKG_CONFIG='pkg-config'
uname -v: Darwin Kernel Version 25.1.0: Mon Oct 20 19:34:03 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T8112
ProductName:		macOS
ProductVersion:		26.1
BuildVersion:		25B78
lldb --version: lldb-1703.0.31.2
Apple Swift version 6.2 (swiftlang-6.2.0.19.9 clang-1700.3.19.1)

What did you do?

I put a cursor on the function and call rename, after that I get:

Image

The name filled with the wrong data: func() commands.BuildInfo. Everything is fine when I put the cursor exactly on the name of the function: Image

The problem is happens in neovim (I simply checked that VSCode contains it, it did): Image

What did you expect to see?

I expect to see the name of the function and replace to work as if I put the cursor on the name of the function.

What did you see instead?

When I press enter I get: Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.RefactoringIssues related to refactoring toolsToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions