Bug 168695 - [preferences] allow users to automatically load externally changed file
Summary: [preferences] allow users to automatically load externally changed file
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P4 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
: 174146 174252 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-12-20 09:47 EST by Ulrich Scholz CLA
Modified: 2009-08-30 02:25 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Scholz CLA 2006-12-20 09:47:50 EST
Build ID: Version 3.2.0 M20060629-10-5

Steps To Reproduce:
1. enable "Refresh automatically"
2. open a file in an editor
3. edit this file externally and save it
-> editor shows the changes automatically
4. edit this file a second time and save it
-> editor does not show the changes
5. go with mouse onto Eclipse editon
-> Eclipse asks "file has changed ..."
Then behaviour continues with point 3.

More information:
every other time, Eclipse asks for confirmation - that's a bug.

BTW. One should be able to specify "auto-reverse" on a file basis!
Comment 1 Dani Megert CLA 2006-12-20 10:15:19 EST
I cannot reproduce step 4 i.e. that works for me. NOTE: the auto-refresh mechanism is not live i.e. it runs from time to time and hence you might have hit before it ran.

>BTW. One should be able to specify "auto-reverse" on a file basis!
Do you really need this on a per file basis? Wouldn't it be good enough never to ask if "Refresh automatically" is checked? Of course there would always be a dialog for dirty files. 
Comment 2 Ulrich Scholz CLA 2006-12-20 10:36:43 EST
> I cannot reproduce step 4 i.e. that works for me. NOTE: the auto-refresh
> mechanism is not live i.e. it runs from time to time and hence you might have
> hit before it ran.

You are right! I'm just too fast. But then Eclipse should simply refresh a file (if auto-refresh is on) in case if there is a difference between its version in the editor and on disc.

> Wouldn't it be good enough never to ask if "Refresh automatically" is 
> checked? Of course there would always be a dialog for dirty files. 

Sorry, I don't understand this comment.  

I'd like to see "Refresh automatically" on a file-by-file basis because normally I'd like to know if "something" changes my files.  Only for some exceptional files, e.g. logfiles, I know in advance that it is allright.
Comment 3 Dani Megert CLA 2006-12-20 11:08:40 EST
>Sorry, I don't understand this comment.  
Exactly what you wrote in the first paragraph of comment 2 ;-)
Comment 4 Ulrich Scholz CLA 2006-12-20 11:22:41 EST
> Wouldn't it be good enough never to ask if "Refresh automatically" is 
> checked? 

That would be almost all the way.  But see my last paragraph of comment #2.

> Of course there would always be a dialog for dirty files. 

But if "Refresh automatically" is globally active (i.e., for all files) what then is a "dirty file" (in comparison to a "normal file" that has been changed externally)?  
Comment 5 Ulrich Scholz CLA 2006-12-20 11:24:48 EST
(In reply to comment #4)

> > Of course there would always be a dialog for dirty files. 
> 
> But if "Refresh automatically" is globally active (i.e., for all files) what
> then is a "dirty file" (in comparison to a "normal file" that has been changed
> externally)?  

please ignore my last comment.  Sorry.

Comment 6 Dani Megert CLA 2006-12-20 11:36:44 EST
If you want both then you need two bug reports ;-)
Comment 7 Ulrich Scholz CLA 2006-12-20 11:51:34 EST
(In reply to comment #6)
> If you want both then you need two bug reports ;-)

No, I don't want to ask for too much.

> Wouldn't it be good enough never to ask if "Refresh automatically" is 
> checked? Of course there would always be a dialog for dirty files. 

That would be perfect.

Ulrich


Comment 8 Dani Megert CLA 2006-12-21 04:02:29 EST
OK then. Since this mainly applies to the textual editors I move this to Platform Text.
Comment 9 Dani Megert CLA 2007-01-04 10:26:57 EST
On a closer look we cannot reuse the existing preference because
- it is on a different layer and 
- a user might want to disable auto-referesh of the workspace but have the 
  content of editors updated automatically
Comment 10 Alex Blewitt CLA 2007-02-16 04:30:04 EST
*** Bug 174146 has been marked as a duplicate of this bug. ***
Comment 11 Dani Megert CLA 2007-02-20 02:17:08 EST
*** Bug 174252 has been marked as a duplicate of this bug. ***
Comment 12 Dani Megert CLA 2007-02-20 02:21:52 EST
Another problem is that the refresh might have not yet been processed when switching back and hence you might get unexpectedly asked when saving the file.

What if the file in Eclipse is dirty?
Comment 13 Alex Blewitt CLA 2007-02-20 04:04:03 EST
I don't think this necessarily needs to apply to just text editors, but certainly it might make sense to implement it for these to start. 

I think that the behaviour if the editor is dirty is to do the same in Eclipse at the moment -- that is, don't prompt for changes (but maybe report that the file is out of sync when saving).

PS for reference, NetBeans 5.5 and IntelliJ 6.0 automatically reload changes in editors made outside the IDE when the editor is activated. I can check what happens in the dirty situation. It was pleasantly surprising to do some changes and see them automatically updated -- I can understand how a user coming from one of those to Eclipse would be frustrated.

PPS if a new preference is enabled, then having a 'Do this from now on' checkbox on the dialog would also be a good place to enable the user to make the change.

PPPS can I help out with providing a patch for this?
Comment 14 Dani Megert CLA 2007-02-20 04:18:11 EST
>I don't think this necessarily needs to apply to just text editors, but
>certainly it might make sense to implement it for these to start. 
Agree. Hence Platform UI (or IDE) should offer that preference and once it is there editors can start to adopt it - textual editors being the first ones.
==> moving to Platform UI to add such a preference.

I'm moving this back to UI to provide such a preference on the 'General' > 'Editors' preference page.

>I think that the behaviour if the editor is dirty is to do the same in Eclipse
>at the moment -- that is, don't prompt for changes
That's not how text editors currently behave. They always prompt if you activate an editor that operates on a out-of-sync file. And I think this should even be done if the preference is enabled because when we do it on save the user might have lost the context already.

>I can check what happens in the dirty situation.
Yes please.

>It was pleasantly surprising to do some changes
>and see them automatically updated
Eclipse editors do that too if
1. the file in eclipse is not dirty
2. the save outside eclipse is recognized and sent as resouce
   delta by Platform Core before the user (too quickly ;-) switches back

>PPS if a new preference is enabled, then having a 'Do this from now on'
>checkbox on the dialog would also be a good place to enable the user to make
>the change.
+1

>PPPS can I help out with providing a patch for this?
I think if Platform UI agrees to provide the preference then this would be a nice spot for providing the patch. I can then add adopt in in Platform Text.
Comment 15 Eric Moffatt CLA 2007-03-05 10:25:50 EST
Boris, I added you since you've been in the code most recently but I've assigned it to Duong since he's the component owner...
Comment 16 Tod Creasey CLA 2007-03-14 15:28:16 EDT
We are interested in looking at a patch if anyone would like to contribute one.
Comment 17 Miles Parker CLA 2007-03-22 09:35:30 EDT
I'd like to support reopening/assigning this bug. For my usage -- examining the output of an executable --  it is unworkable to the extent that I am having to write code that sends file to console to avoid clicking through these dialogs. I might suggest finer-grain control, that is you could set a file type or working set only to be auto-refresed.
Comment 18 Tod Creasey CLA 2007-03-22 10:07:28 EDT
if you submit a patch we would be happy to review it
Comment 19 Denis Roy CLA 2009-08-30 02:25:21 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.