-
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/refactor, rename: add -d option to show diffs #13355
Comments
Why not instead make the IDE's undo operation work as expected when a source file is externally modified? |
I think the point is that gorename is used as part of the opaque On Sat, Nov 21, 2015 at 8:55 PM, Matthew Dempsky notifications@github.com
|
@RLH That's right. Editors/IDEs undo stacks never include edits to files made outside of the editor as far as I'm aware. Any action invoked by the user inside the editor is expected to make its modifications to editor buffers via the editors own text buffer APIs so that those edits are tracked on the undo stack. Pretty sure all of that is standard across tools. So to have undo support, we would need forename to provide the set of edits and the editor plugin to actually apply these using the editors APIs. |
Output in unified diff (or similar) format will also allow IDEs to show preview of the changes before applying them. |
@kostya-sh Agreed - using the same rendering as |
/cc @alandonovan |
For IDE integrations, having
gorename
modify files directly means that the editor's undo operation will not work as expected. It would be nice ifgorename
had a flag to dump the proposed modifications to stdout instead.The text was updated successfully, but these errors were encountered: