-
Notifications
You must be signed in to change notification settings - Fork 321
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
Refresh on Access does not work for Xtext editors #2385
Comments
@szarnekow are you actively working on this? |
Not on the fix for the current impl in isolation, no |
That is what we've also just found. We plan to provide a PR that should fix that, current state is just not acceptable from the user point of view. |
Removing the isSynchronized implementation and make use of its super implementation works. But for the case if the editor was dirty and the file was edited outside of eclipse, the user gets a dialog in which he can choose loading of the new content or ignore the change. If the user selects to ignore the changes, the dirty editor can't save it anymore, because the file is out of sync. So I am going to investigate this problem too. |
This bugfix contains the fix for unsync workspace files wrt. the file system (see the DirtyStateEditorSupportIntegrationTest.testModifyFileInExternEditor) and a one liner for beeing able to save the file when the changes were ignored. (see the ignored test case DirtyStateEditorSupportIntegrationTest.testModifyDirtyFileInExternEditor). The issue for this fix can be found here: eclipse-xtext#2385
This bugfix contains the fix for unsync workspace files wrt. the file system (see the DirtyStateEditorSupportIntegrationTest.testModifyFileInExternEditor) and a one liner for beeing able to save the file when the changes were ignored. (see the ignored test case DirtyStateEditorSupportIntegrationTest.testModifyDirtyFileInExternEditor). The issue for this fix can be found here: eclipse-xtext#2385
This bugfix contains the fix for unsync workspace files wrt. the file system (see the DirtyStateEditorSupportIntegrationTest.testModifyFileInExternEditor) and a one liner for beeing able to save the file when the changes were ignored. (see the ignored test case DirtyStateEditorSupportIntegrationTest.testModifyDirtyFileInExternEditor). The issue for this fix can be found here: eclipse-xtext#2385
This bugfix contains the fix for unsync workspace files wrt. the file system (see the DirtyStateEditorSupportIntegrationTest.testModifyFileInExternEditor) and a one liner for beeing able to save the file when the changes were ignored. (see the ignored test case DirtyStateEditorSupportIntegrationTest.testModifyDirtyFileInExternEditor). The issue for this fix can be found here: eclipse-xtext#2385
This bugfix contains the fix for unsync workspace files wrt. the file system (see the DirtyStateEditorSupportIntegrationTest.testModifyFileInExternEditor) and a one liner for beeing able to save the file when the changes were ignored. (see the ignored test case DirtyStateEditorSupportIntegrationTest.testModifyDirtyFileInExternEditor). The issue for this fix can be found here: eclipse-xtext#2385
This bugfix contains the fix for unsync workspace files wrt. the file system (see the DirtyStateEditorSupportIntegrationTest.testModifyFileInExternEditor) and a one liner for beeing able to save the file when the changes were ignored. (see the ignored test case DirtyStateEditorSupportIntegrationTest.testModifyDirtyFileInExternEditor). The issue for this fix can be found here: eclipse-xtext#2385
This bugfix contains the fix for unsync workspace files wrt. the file system (see the DirtyStateEditorSupportIntegrationTest.testModifyFileInExternEditor) and a one liner for beeing able to save the file when the changes were ignored. (see the ignored test case DirtyStateEditorSupportIntegrationTest.testModifyDirtyFileInExternEditor). The issue for this fix can be found here: eclipse-xtext#2385
This bugfix contains the fix for unsync workspace files wrt. the file system (see the DirtyStateEditorSupportIntegrationTest.testModifyFileInExternEditor) and a one liner for beeing able to save the file when the changes were ignored. (see the ignored test case DirtyStateEditorSupportIntegrationTest.testModifyDirtyFileInExternEditor). The issue for this fix can be found here: eclipse-xtext#2385
This bugfix contains the fix for unsync workspace files wrt. the file system (see the DirtyStateEditorSupportIntegrationTest.testModifyFileInExternEditor) and a one liner for beeing able to save the file when the changes were ignored. (see the ignored test case DirtyStateEditorSupportIntegrationTest.testModifyDirtyFileInExternEditor). The issue for this fix can be found here: eclipse-xtext#2385
This bugfix contains the fix for unsync workspace files wrt. the file system (see the DirtyStateEditorSupportIntegrationTest.testModifyFileInExternEditor) and a one liner for beeing able to save the file when the changes were ignored. (see the ignored test case DirtyStateEditorSupportIntegrationTest.testModifyDirtyFileInExternEditor). The issue for this fix can be found here: eclipse-xtext#2385
This bugfix contains the fix for unsync workspace files wrt. the file system (see the DirtyStateEditorSupportIntegrationTest.testModifyFileInExternEditor) and a one liner for beeing able to save the file when the changes were ignored. (see the ignored test case DirtyStateEditorSupportIntegrationTest.testModifyDirtyFileInExternEditor). The issue for this fix can be found here: #2385
@szarnekow |
Indeed. Thank you for the heads-up. |
@mehmet-karaman one of the added tests seems to be flaky (especially in macOS):
maybe some refresh should be explicitly executed before the assertion? |
I am going to check this. |
@mehmet-karaman sorry to go back to this, but
I guess that the assertEquals(document.get(), ""); should be assertEquals("", document.get()); shouldn't it? |
Shouldn't |
Thanks for the hints.. Created a new PR which contains these changes: #3275 |
Refresh on Access does not work for Xtext editors
(2) configure workspace for refresh on access
(1) open a Xtext based dsl file
(2) modify on disk
(3) click into the editor
Expected behaviour:
Editor refreshes (e.g. as
.java
or.txt
)Actual behaviour:
Editor does not refresh
This is caused by the customization in
org.eclipse.xtext.ui.editor.model.XtextDocumentProvider.isSynchronized(Object)
i have no idea why the code there is like it is and what doing some copy&paste from superclass would break
Question: can the
XtextDocumentProvider
be fixed without breaking something elseThe text was updated successfully, but these errors were encountered: