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
Command - Undo Replace All #47783
Comments
(Experimental duplicate detection) |
Bot, as usual, will look for something that has nothing to do with my entry... |
Command-undo Replace all |
Might not be trivial because there could be edits to the file at the location where replace has happened and undo has to ignore that. |
@sandy081 So the button should work only until some manual change is made to these files. |
IntelliJ IDEA family of IDEs has this feature. |
Starting to see the above comment as the reality more and more... :-/ |
It would be really useful to have this feature, I'm |
I support this for instances when I'm not paying attention and accidentally do find-replace to an entire project instead of just the open file. Cleaning up the mess is both humiliating and absurdly tedious. |
I hope we cann't undo all files , If this possibility there mean its great . please share the same how to undo all replaced files. Replace all feature is very helpful, but we should be careful when applying this with all files. Better we should apply some filters like file extension , include and/or exclude files , I attached reference screenshot also. |
I think perhaps we need this command, because if i replace some thing by mistake,i need to replace them by replacing command again. |
At least there should be a warning if you accidentally forget to fill out the lower field and replace every occurrence of the searched item with an empty string. |
@mortizw I mean situations when I have already changed something and LATER I realized that I did it incorrectly or unnecessarily. A warning is not enough for this. |
@sandy081 Not really. The "replace all" action should be no different from a manual change that lands on the "undo" stack. Undo is a stack and you can only undo the most recent change. "Replace all" action should land on this very stack, and be undoable when it's on the top of the stack. In this case, there's "no [other] edits to ignore". That's how it works in IntelliJ IDEA. Worth noting, hitting ^Z in IntelliJ IDEA will trigger an alert like "Do you want to undo replace all?" if "undo all" is on top of the undo stack. This is because a typical ^Z action is usually very small, except when it's undoing a "replace all", and doing so could potentially be disastrous. (But not really since you can CTRL+SHIFT+Z to undo the undo...) |
Well, I just accidentally modified 423 lines of code in 123 files. |
And I just screwed up my regex, and now have to fix 132 changes manually. |
This is why I just use JetBrains IDEs for development now... #youGetWhatYouPayFor |
@RavenHursT I mean, you're right, but there's no way I'm going to pay JetBrains' prices. I'd love to donate a bit to VSCode, but not nearly what JetBrains charge (at least not as a lump sum). Besides, JetBrains IDEs have many other issues that bother me much more:
|
Chiming in — this would be a great (albeit nontrivial) feature |
Thanking myself for googling this up right before a major replace all... |
Chiming in too. Of course I could be wrong but I don't see why this is a non-trivial feature to implement. If I do a replace all and I go to an individual file, I can Definitely a much needed feature considering how powerful vscode's replace all feature is. |
A solution would be to just use the normal undo stack! And to keep a mapping to what a replace all had as entries! When the replace all undo is triggered! The mapping is used! We check for the whole list of files that were modified! And See if they were top in stack! If all are! And in the right stacked order for all file! Then it's doable and it can be handled! Now for performance! One can optimize by listening to redo/undo stack of each concerned file! More thinking can go in the thing! Otherwise too a simple format! Straight forward! Not the most cool thing! But very helpful! Simply make it happen when no changes were made! Because a lot of times one hit replace all! And at the instant it's done! You know you made a mistake! You just want to cancel that! May be that's the most common scenario! (for this only! The implementation is straight forward! After a replace all! All the changed files listing (paths, id whatever) are saved in memory! to revert just do an undo file by file! If any of the file is modified before that! One can keep offering reverting the rest! And open the files with undo problem! And changed! EVen though using the stack and with walk through resolution is the cool thing! And require some work! For a cool handling! And simple walk through! In the worst cases! Now clearly it's a matter of hands! (Time and will) ! Because that can go too as an extension! Why i will not be the one to do it !? My partner is already shouting! Focus mm i think i may go for an extension! Start with the simple version! Then one see! |
Missing. And a button in the Search panel would be useful. |
@hediet There must be at least one file open where Replace All made a change. That means:
Strange behavior. The button in the Search Panel would have to work like this:
Then there would be the behavior that is needed. BTW From which version did VSCode start working as you show? It has always been? |
@lukaszpolowczyk so wait.. any file that VSCode wasn't to do a replace all/undo on has to be first opened in the editor before the text changes can be made? Why isn't something like this just done in memory and just written to disk? Is there some kind of limitation "under the hood" on replace/undo that only works in files opened in editor tabs? |
@RavenHursT Replace All worked for both open and unopened files. I think the context for Undo, is the active tab. As I wrote, this is strange behavior and should be fixed. |
💯 % agree @lukaszpolowczyk |
This may be an indirect question to this matter but, how do I keep the files I've performed a replacement on open after the procedure? Because, currently (to me), I Ctrl+SHIFT+H for the action but the files only remain open if I replace each occurrence manually, one entry after another (thus defeating the purpose of a batch replacement). While batching, all files are closed after VSCode finished work with each one of them. I don't know how to explain but, it's like the replacement action takes place in the background or then it's like if it happens so fast that not all files in which a replacement had been performed end up being registered in the Recently Opened Files. Here's a hypothetical scenario to describe what just happened to me: I had like 4 files (a, b, c, d) with 3 others previously closed (e, f, g) in history. Then I needed to replace something in 5 other files (h, i, j, k, l). Action completed, affected files closed instead of remaining open as desired, but when I Ctrl+SHIFT+T to reopen them, the files brought to me were, let's say, Hope I didn't complicate too much with the example >.< |
Read this comment: #47783 (comment) |
It's been 4 years, this still isn't a thing yet? |
@CodeBradley 4 more years! |
O god, IT WOULD BE REALLY NICE IF THERE IS A BUTTON THAT SAYS "UNDO ALL CHANGES" i would have died with peace 💯 |
I still get the empty array in Android while fetching products using getProducts(). NEED HELP, it's over 24 hrs I have created subscription products in play store, but still not showing |
Any update? |
I agree, this would be a really nice feature! |
Lol.. going on 6 years later.. VSCode is a text editor w/ a whole slew of plugins to make it "act like" a true IDE. Still working in JetBrains and lovin' it. Just did a "coding exercise" on codingsandbox.io, which uses VSCode as it's basis for it's interface, and good Lawd that was painful! I had to keep refreshing the window just to get TypeScript annotation corrections to be picked up by the editor. Absolute garbage.. JetBrains is like, $10/mo to use ALL of their IDEs.. Again, #YouGetWhatYouPayFor 😉 |
In Search Panel should be button "Undo Replace All", whitch undo all "replaced" changes in all files.
Should to be work like standard undo function, but only for files whitch "Replace All" made a changes.
It looks something simple to introduce. Am I right?
The text was updated successfully, but these errors were encountered: