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

Bug 368800

Summary: [Xtext] [EmbeddedEditorFactory] HighlightingHelper should be installed as default.
Product: [Modeling] TMF Reporter: Holger Schill <Holger.Schill>
Component: XtextAssignee: Holger Schill <Holger.Schill>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow, sven.efftinge
Version: 2.3.0Flags: sebastian.zarnekow: juno+
Target Milestone: M7   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Suggested fix
none
New version with less API changes none

Description Holger Schill CLA 2012-01-17 04:27:05 EST
As you can see here: org.eclipse.xtext.ui.codetemplates.ui.preferences.AdvancedTemplatesPreferencePage.createViewer(Composite) the 
org.eclipse.xtext.ui.codetemplates.ui.partialEditing.HighlightingHelper is installed manually. Possible clients of EmbeddedEditorFactory have to do this every time. This should be installed as default.
Comment 1 Holger Schill CLA 2012-04-17 10:07:37 EDT
It would be nice to move the classes from org.eclipse.xtext.ui.codetemplates.ui.partialEditing to org.eclipse.xtext.ui.editor.embedded but I am afraid we will ran into API problems? 

What do others think?
Comment 2 Sven Efftinge CLA 2012-04-19 03:38:51 EDT
That package is not exported as public but is internal, so we could move it.
Comment 3 Sebastian Zarnekow CLA 2012-04-19 03:41:08 EDT
These classes duplicate code which is not really extensible in the original classes. I think we should not move them but fix the original code, instead.
Comment 4 Holger Schill CLA 2012-04-23 04:30:13 EDT
I see. These two candidates are just a copies of stuff that is inside of org.eclipse.xtext.ui.editor.syntaxcoloring. 

org.eclipse.xtext.ui.codetemplates.ui.partialEditing.HighlightingHelper
org.eclipse.xtext.ui.codetemplates.ui.partialEditing.HighlightingReconciler

I think marking some methods protected instead of private in the implementation would solve the issue but the modified implementations should be move to org.eclipse.xtext.ui.editor.embedded I think.
Comment 5 Holger Schill CLA 2012-04-23 05:35:55 EDT
Created attachment 214377 [details]
Suggested fix
Comment 6 Sebastian Zarnekow CLA 2012-04-23 05:53:30 EDT
Thanks for the proposed patch. Do we have to mark everything as protected? This renders a lot of internal state to be API which I'd not recommend for this low level component.
Comment 7 Holger Schill CLA 2012-04-23 06:04:21 EDT
No we do not have to mark everything as protected but I thought it could be usefull for other possible clients but you are right. I will reduce the visibility as much as possible.
Comment 8 Holger Schill CLA 2012-04-23 10:06:49 EDT
Created attachment 214393 [details]
New version with less API changes
Comment 9 Sebastian Zarnekow CLA 2012-04-23 10:14:17 EDT
Looks good. +1
Comment 10 Holger Schill CLA 2012-04-23 10:21:48 EDT
pushed patch to master.
Comment 11 Eclipse Webmaster CLA 2017-10-31 10:47:16 EDT
Requested via bug 522520.

-M.
Comment 12 Eclipse Webmaster CLA 2017-10-31 10:58:24 EDT
Requested via bug 522520.

-M.