Open stamblerre opened 4 years ago
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 :slightly_smiling_face:
(PING/KEEPALIVE) Hi guys ...any news on this feature? Given that GO doesnt have method overloads, this is a super critical need, since you cannot get away with search and replace to make these refactorings with a text editor/grep etc. Seems a bit overkill to have 1 person in the dev team manage all method refactorings with a single goland licence.
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: gopls/internal/golang: support removing unused parameters from methods
Change https://go.dev/cl/581535 mentions this issue: gopls/internal/golang: support parameter movement refactorings
Change https://go.dev/cl/631296 mentions this issue: gopls/internal/golang: change signature via renaming 'func'
See https://github.com/microsoft/vscode-go/issues/3122 for the original request.