Need to save before copy-pasting files [message #1807181] |
Fri, 24 May 2019 08:11  |
Eclipse User |
|
|
|
There's this thing which has been a constant source of irritation for me when using eclipse. Perhaps someone here can shed some light on why this is happening.
Working with Java in the Package Explorer, I sometimes need to copy-paste a java file from the source tree to create a new class that I need to reference in the file I am currently editing.
I can copy the source file with ctrl-c but as soon as I try to paste it with ctrl-v, eclipse comes up and demands that I save all my current edit windows first. I can have perhaps 4-5 edit windows open that are all in this state of half-way-done and I'm just not ready to save all that just yet. But eclipse absolutely insists that I do that, because this is somehow super critical to creating a new file As if the new file will somehow be wrong if I don't save everything I have in my edit windows. Like, wtf?
The strange thing is that I can simply switch to the Navigator view and paste the file in there - no problemo.
As you can tell I'm not super impressed with this behavior. I'll happily save my work if I understand why it's important, but right now it just feels like eclipse is toying with me for no good reason.
-Michael
|
|
|
Re: Need to save before copy-pasting files [message #1807194 is a reply to message #1807181] |
Fri, 24 May 2019 12:40   |
Eclipse User |
|
|
|
You could open a bug report against JDT-UI. But better would be to provide a patch :-) I'm not familiar with this code, but I *think* a starting point might be this PasteAction class and its associated pasters (maybe its sub-type JavaElementAndResourcePaster?). I did some other poking about and came across a IReorgPolicy which has a `getSaveMode()` which defaults to a SAVE_ALL. I suspect somehow either making that pluggable, or providing a specialized IReorgPolicy for pasting files that uses SAVE_NONE, might do the trick.
Brian.
|
|
|
Re: Need to save before copy-pasting files [message #1807238 is a reply to message #1807194] |
Sat, 25 May 2019 13:10   |
Eclipse User |
|
|
|
"Your ideas are intriguing to me and I wish to subscribe to your newsletter" as a lovable cartoon character once said.
But seriously - I understand some of the words you say and they sound really smart. I hope that more skillful developers will pick up on this and provide a patch, because this is one of those things that just make me want to switch to another editor which is already packed with intelligent IDEAs.
- Mike
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05376 seconds