-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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/gopls: support change signature refactoring #38028
Comments
We could also use change signature as a suggested fix for the fillreturns analyzer. /cc @joshbaum |
I would greatly appreciate this feature! thanks for your work on gopls by the way 🙂 |
(PING/KEEPALIVE) This thread looks dead, (no movement since October 2020) does this mean that as a noobie GOLANG user I've missed something (obvious to the wise grey haired folk) that makes this a non issue? please advise...txs, Alan |
FWIW this is now very feasible as a result of the inlining work @adonovan has been doing (e.g. #62650): a change signature refactoring can be implemented using inlining by creating a synthetic callee with the new signature, delegating the body of the current callee to the synthetic callee, and inlining the current callee. In other words, Alan has done all the really hard (surprisingly hard) work of making inlining correct and safe, and change signature refactoring is now "just bookkeeping"... Of course, it's not quite that easy:
|
Change https://go.dev/cl/572296 mentions this issue: |
Make a minimal change to the removeparam algorithm to support removing unused parameters of methods. This doesn't address the problem of expanding the set of signatures or calls based on interface satisfaction constraints: that is really a separate concern, which also affects method renaming (golang/go#58461). Were we to have a more general solution to that problem, it would be relatively straightforward to also expand the change signature algorithm. For golang/go#38028 Change-Id: I296cb1f828f07d841c83b1fd33593ccd2fee3539 Reviewed-on: https://go-review.googlesource.com/c/tools/+/572296 Reviewed-by: Alan Donovan <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
See microsoft/vscode-go#3122 for the original request.
The text was updated successfully, but these errors were encountered: