Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368827

Summary: [Xtext] [EmbeddedEditor] bogus selection after initial creation with empty initial model
Product: [Modeling] TMF Reporter: Holger Schill <Holger.Schill>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sylvain.heraud
Version: 2.3.0   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:

Description Holger Schill CLA 2012-01-17 09:28:00 EST
When an EmbeddedEditor is created without an initial model org.eclipse.xtext.ui.editor.embedded.EmbeddedEditor.createPartialEditor() and after that somebody calls org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorModelAccess.updateModel(String, String, String) the complete input is selected.

Hacky workaround: 
Call createPartialEditor("","x","",false") with a single char.
Comment 1 Holger Schill CLA 2013-01-28 10:35:35 EST
This is because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=368827 .

I've move the creation of the org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorModelAccess in the hover to a codesection that is only called if there is sugar. When 368827 is fixed we can move the codeline back to createContents without initial content.

pushed to master.
Comment 2 Sylvain Heraud CLA 2014-01-07 09:45:57 EST
Hello,

I have the same issue with Xtext 2.5.0, the workaround still works !
Comment 3 Eclipse Webmaster CLA 2017-10-31 11:06:18 EDT
Requested via bug 522520.

-M.
Comment 4 Eclipse Webmaster CLA 2017-10-31 11:17:39 EDT
Requested via bug 522520.

-M.