Skip to content
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

x/tools/cmd/gorename: tag and delete it #69360

Closed
adonovan opened this issue Sep 9, 2024 · 7 comments
Closed

x/tools/cmd/gorename: tag and delete it #69360

adonovan opened this issue Sep 9, 2024 · 7 comments

Comments

@adonovan
Copy link
Member

adonovan commented Sep 9, 2024

The cmd/gorename tool long predates the LSP and gopls, and its functionality has since been subsumed by them. We should deprecate and delete the command, following the sequence used for go/pointer in #59676.

Example of using gopls as a batch renaming tool:

$ cat a.go
package main

func main() {
	f()
}

func f() {}

$ gopls rename -write ./a.go:#42 g

$ cat a.go
package main

func main() {
	g()
}

func g() {}

gopls doesn't support the symbolic command-line syntax for choosing the symbol to rename:

I wonder how many people actually use it, instead of specifying the symbol by position (e.g. byte offset 42 in the example above).

@gopherbot gopherbot added this to the Proposal milestone Sep 9, 2024
@gabyhelp
Copy link

gabyhelp commented Sep 9, 2024

Related Issues and Documentation

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@rsc rsc changed the title proposal: x/tools/cmd/gorename: deprecate and delete it proposal: x/tools/cmd/gorename: tag and delete it Sep 11, 2024
@rsc rsc changed the title proposal: x/tools/cmd/gorename: tag and delete it proposal: x/tools/cmd/gorename: tag and delete it Sep 11, 2024
@rsc
Copy link
Contributor

rsc commented Sep 11, 2024

Based on the discussion above, this proposal seems like a likely accept.
— rsc for the proposal review group

The proposal is to tag one last version of x/tools/cmd/gorename (in its own sub-module) and then delete it from the repo. go install will still work because it will find the old version.

@gopherbot
Copy link
Contributor

gopherbot commented Sep 18, 2024

No change in consensus, so accepted. 🎉
This issue now tracks the work of implementing the proposal.
— aclements for the proposal review group

The proposal is to tag one last version of x/tools/cmd/gorename (in its own sub-module) and then delete it from the repo. go install will still work because it will find the old version.

@gopherbot gopherbot changed the title proposal: x/tools/cmd/gorename: tag and delete it x/tools/cmd/gorename: tag and delete it Sep 18, 2024
@gopherbot gopherbot modified the milestones: Proposal, Backlog Sep 18, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/614158 mentions this issue: cmd/gorename: create submodule

@adonovan adonovan self-assigned this Sep 19, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/614159 mentions this issue: x/tools: remove refs to cmd/gorename

@dmitshur dmitshur modified the milestones: Backlog, Unreleased Sep 19, 2024
gopherbot pushed a commit to golang/tools that referenced this issue Sep 19, 2024
gorename is deprecated.
(Use gopls's Rename RPC or rename command instead.)

Once this module is tagged, we will delete it.
Clients will be able to use only the last version.

Updates golang/go#69360

Change-Id: I89ea5feade02f9fb15c7244847810f3c2261f7ff
Reviewed-on: https://go-review.googlesource.com/c/tools/+/614158
Auto-Submit: Alan Donovan <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
gopherbot pushed a commit to golang/tools that referenced this issue Sep 19, 2024
Too bad I didn't include refactor/{rename,importgraph}
in the current proposal; they will need another.

Updates golang/go#69360

Change-Id: I8af544515893a0663621a19768adf64798c93671
Reviewed-on: https://go-review.googlesource.com/c/tools/+/614159
Reviewed-by: Ian Lance Taylor <[email protected]>
Auto-Submit: Alan Donovan <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/614635 mentions this issue: cmd/gorename: remove replace directive

gopherbot pushed a commit to golang/tools that referenced this issue Sep 20, 2024
This makes it so that 'go install golang.org/x/tools/cmd/gorename@latest'
will continue to work. ('go install pkg@version' does not allow
replace directives.)

Updates golang/go#69360

Change-Id: I46a16a5d8dc7d1d1cf6c428388484e27f266f4e2
Reviewed-on: https://go-review.googlesource.com/c/tools/+/614635
Auto-Submit: Alan Donovan <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/614675 mentions this issue: cmd/gorename: delete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Accepted
Development

No branches or pull requests

5 participants