-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Partial cross-file undo if a file is changed in the meantime #99159
Comments
I ran into quite a few problems trying to test around this.
|
felt this way as well |
That is a valid idea, but IMHO would be slightly worse. For example, to undo a variable rename in 10 out of 15 files would make it likely that many users won't realize which files have been missed by the undo. IMHO, people expect that cross-file operations (basically edits which people cannot see) should execute only under perfectly safe conditions. For example, doing a rename where TypeScript only renames an unpredictable number of usages (but not all usages) is not acceptable. IMHO it is better for the editor to be predictable and fail fast than do something surprising. Running the undo in the focused file is still unsafe, since it basically introduces very many compile errors in such cases, but IMHO this is the slightly less surprising default, because users can immediately see the effects of the undo operation since they have the file opened. This is consistent with IDEs I have tried like eclipse.
The undo stack is not something that you can really see, so trying to go to other files that were edited in the meantime and hitting Cmd+Z a specific number of times to stop right before the cross file undo is IMHO unrealistic. The ability to undo is not permanently lost. The ability to undo in one step across all files is permanently lost. It is still possible to open each and every file and undo locally as much as needed. I acknowledge that you would like a prompt between local / partial / cancel.
This is its own feature request, please create a new issue. The ability to undo a specific element in the undo stack (not the most recent one) is something people have asked about before and I think it deserves its own issue.
This is a good idea, but there are certain expectations that it would break. For example, if there are many compile errors at the time of the undo, many symbols might be missed by the "undo rename". The current textual based undo has the contract that it will bring the file(s) back to a state that existed in the past. Finally, thanks for the good feedback. I suggest the following:
|
Testing #98987
Repro:
🐛 => cross-file undo does not work at all. Could we fix a majority of the files that don't have this issue?
The text was updated successfully, but these errors were encountered: