vscode-go icon indicating copy to clipboard operation
vscode-go copied to clipboard

Renaming Interface Functions Does Not Affect Implementations

Open FloatingSunfish opened this issue 3 years ago • 0 comments

What version of Go, VS Code & VS Code Go extension are you using?

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
    • go version go1.19 windows/amd64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
    • golang.org/x/tools/gopls v0.9.4
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
    • 1.71.0
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.35.2
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
Checking configured tools....
GOBIN: undefined
toolsGopath: 
gopath: C:\Users\Admin\go
GOROOT: C:\Program Files\Go
PATH: C:\Program Files\Eclipse Adoptium\jdk-17.0.2.8-hotspot\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\swigwin;C:\gallery-dl;C:\ffmpeg\bin;C:\platform-tools;C:\Program Files\Go\bin;C:\TDM-GCC-64\bin;C:\Program Files\Git\cmd;C:\Users\Admin\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\Admin\AppData\Local\Programs\Python\Python310\;C:\Users\Admin\AppData\Local\Microsoft\WindowsApps;;C:\Users\Admin\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\JetBrains\PyCharm Community Edition 2022.2.1\bin;;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.1.3\bin;;C:\Users\Admin\go\bin;C:\Users\Admin\.dotnet\tools

	go:	C:\Program Files\Go\bin\go.exe: go version go1.19 windows/amd64

	gotests:	C:\Users\Admin\go\bin\gotests.exe	(version: v1.6.0 built with go: go1.19)
	gomodifytags:	C:\Users\Admin\go\bin\gomodifytags.exe	(version: v1.16.0 built with go: go1.19)
	impl:	C:\Users\Admin\go\bin\impl.exe	(version: v1.1.0 built with go: go1.19)
	goplay:	C:\Users\Admin\go\bin\goplay.exe	(version: v1.0.0 built with go: go1.19)
	dlv:	C:\Users\Admin\go\bin\dlv.exe	(version: v1.9.0 built with go: go1.19)
	golangci-lint:	C:\Users\Admin\go\bin\golangci-lint.exe	(version: v1.48.0 built with go: go1.19)
	gopls:	C:\Users\Admin\go\bin\gopls.exe	(version: v0.9.4 built with go: go1.19)

go env
Workspace Folder (playground): e:\_To_Backup\_02_To_Copy_Periodic\ProjectCodes\GoCodes\playground
	set GO111MODULE=
	set GOARCH=amd64
	set GOBIN=
	set GOCACHE=C:\Users\Admin\AppData\Local\go-build
	set GOENV=C:\Users\Admin\AppData\Roaming\go\env
	set GOEXE=.exe
	set GOEXPERIMENT=
	set GOFLAGS=
	set GOHOSTARCH=amd64
	set GOHOSTOS=windows
	set GOINSECURE=
	set GOMODCACHE=C:\Users\Admin\go\pkg\mod
	set GONOPROXY=
	set GONOSUMDB=
	set GOOS=windows
	set GOPATH=C:\Users\Admin\go
	set GOPRIVATE=
	set GOPROXY=https://proxy.golang.org,direct
	set GOROOT=C:\Program Files\Go
	set GOSUMDB=sum.golang.org
	set GOTMPDIR=
	set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
	set GOVCS=
	set GOVERSION=go1.19
	set GCCGO=gccgo
	set GOAMD64=v1
	set AR=ar
	set CC=gcc
	set CXX=g++
	set CGO_ENABLED=1
	set GOMOD=e:\_To_Backup\_02_To_Copy_Periodic\ProjectCodes\GoCodes\playground\go.mod
	set GOWORK=
	set CGO_CFLAGS=-g -O2
	set CGO_CPPFLAGS=
	set CGO_CXXFLAGS=-g -O2
	set CGO_FFLAGS=-g -O2
	set CGO_LDFLAGS=-g -O2
	set PKG_CONFIG=pkg-config
	set GOGCCFLAGS=-m64 -mthreads -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\Admin\AppData\Local\Temp\go-build1366559408=/tmp/go-build -gno-record-gcc-switches

Share the Go related settings you have added/edited

Run Preferences: Open Settings (JSON) command to open your settings.json file. Share all the settings with the go. or ["go"] or gopls prefixes.

"go.formatTool": "gofmt",
"go.lintFlags": [
    "--fast"
],
"go.lintOnSave": "workspace",
"go.lintTool": "golangci-lint",
"go.vetOnSave": "workspace",

Describe the bug

When renaming interface functions, the gorename tool works as intended when run from the command line and affects all the necessary structs. However, when the same refactoring is done through VS Code, the refactoring doesn't affect the necessary structs.

See the full discussion here.

FloatingSunfish avatar Sep 05 '22 00:09 FloatingSunfish