Community
Participate
Working Groups
Build Identifier: 20100617-1415 When managed by a version control system, the files within an eclipse project are usually in a read-only state when not checked-out. If read-only file is opened in a org.eclipse.wst.sse.ui.StructuredTextEditor based editor and you try to edit, a popup shows asking if you want to remove the read-only flag (or do a checkout operation). If confirmed, the auto-complete popup (shown with ctrl+space command) don't work anymore (shows no items). If you close the file and open it again, the auto-complete proposals works. That behavior applies with XML, JSP, HTML and I believe any editors of that nature. Reproducible: Always Steps to Reproduce: 1. Open a read-only XML based file (XML, JSP, TAGFILE, HTML, XSD). 2. Edit the file, a popup asking if you want to remove the read-only file appears. 3. Click yes. 4. Press ctrl+space 5. Reopen the file, press ctrl+space again and compare what appeared before the file was reopened.
Created attachment 178679 [details] StructuredTextEditor patch to make auto-complete work even if read-only flag is removed within editor It seems the auto-complete problem is related to a variable managed by org.eclipse.ui.texteditor.AbstractTextEditor that is not updated when the read-only flag removal operation within editor is performed. Forcing AbstractTextEditor.updateState(IEditorInput) to always be executed before AbstractTextEditor.updateStateDependentActions() solves the problem. Note that the proposed approach serves as reference so the problem can be addressed suitably.
Comment on attachment 178679 [details] StructuredTextEditor patch to make auto-complete work even if read-only flag is removed within editor This "patch" isn't going to work--it's the entire source file! Additionally, it's had style changes made to the code (always use blocks, refer to fields with 'this.', possibly others) that make it very difficult to find the actual intended change. Please connect anonymously to our CVS repository on host dev.eclipse.org with repository path /cvsroot/webtools and check out the plug-in folder at sourceediting/plugins/org.eclipse.wst.sse.ui into your workspace. Making your changes there will allow you to create a patch we can examine and possibly include in a future release.
Created attachment 178730 [details] Patch of StructuredTextEditor to make auto-complete work even if read-only flag is removed within editor My bad for the previous attachment, hope it helps now.
This bug is a duplicate of Bug 281872.
Thank you very much for your patch, Andre! I think it will address the situation, but I think we have to fix the root of the problem, which is in how the StructuredContentAssistant cleans up its ContentAssistProcessors. We'll be tracking this change through Bug 281872. *** This bug has been marked as a duplicate of bug 281872 ***