Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345690 - [implementation] org.eclipse.ui.editors.text.FileDocumentProvider does not react on file replacement inside eclipse
Summary: [implementation] org.eclipse.ui.editors.text.FileDocumentProvider does not re...
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-13 03:10 EDT by Benjamin Schwertfeger CLA
Modified: 2019-11-14 02:14 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Schwertfeger CLA 2011-05-13 03:10:05 EDT
Build Identifier: 20100917-0705

If an editor with a FileDocumentProvider like Xtext is dirty while replacing the file inside eclipse, the workspace knows the new File (the IFile is synchronized in this case) but the editor should be dirty. The TextFileDocumentProvider uses a FileInfo with i.e. ResourceTextFileBuffer which also compares the last known modification timestamp.

Reproducible: Always

Steps to Reproduce:
1. Open a Xtext-Editor (It depends on synchronization of the FileDocumentProvider)
2. Change the file and do not save
3. Replace the file with one from local history and deny the question to "save"
4. If the editor becomes active again, the file change is not recognized (No message for replace the content is shown)
5. Try to save (Error message, because the file changed)
Comment 1 Dani Megert CLA 2011-05-16 03:39:51 EDT
Xtext should switch to the TextFileDocumentProvider. Most fixes and new work was only done there.
Comment 2 Nitin Dahyabhai CLA 2011-05-16 12:40:27 EDT
FileDocumentProvider doesn't appear to be deprecated, though.
Comment 3 Dani Megert CLA 2011-05-17 02:09:38 EDT
(In reply to comment #2)
> FileDocumentProvider doesn't appear to be deprecated, though.

It can still be used for the old and simple cases (e.g. the class file document provider extends it). Also, when using/extending the textual editors from the SDK you'll get the TextFileDocumentProvider for free.
Comment 4 Lars Vogel CLA 2019-11-14 02:14:08 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.