Skip to content

Renaming Interface Functions Does Not Affect Implementations #2438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
FloatingSunfish opened this issue Sep 5, 2022 · 2 comments
Closed
Assignees
Labels
FrozenDueToAge gopls gopls related issues NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@FloatingSunfish
Copy link

FloatingSunfish commented Sep 5, 2022

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.

@gopherbot gopherbot added this to the Untriaged milestone Sep 5, 2022
@adonovan adonovan added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 8, 2022
@adonovan adonovan modified the milestones: Untriaged, vscode-go/later Sep 8, 2022
@hyangah hyangah added the gopls gopls related issues label Sep 29, 2022
@hyangah
Copy link
Contributor

hyangah commented Oct 4, 2022

Isn't it a duplicate of #2275?

@FloatingSunfish fyi VSCode Go does not use gorename directly, but gets the functionality through gopls. gopls may copy/share some code wigh gorename behind the scene, but the issue is gopls issue.

@FloatingSunfish
Copy link
Author

Hmm, in that case, this Issue might need to be Closed then.
I hope this gopls issue gets fixed then.

@FloatingSunfish FloatingSunfish closed this as not planned Won't fix, can't repro, duplicate, stale Oct 6, 2022
@golang golang locked and limited conversation to collaborators Oct 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls gopls related issues NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants