[232752] [Semantic Highlighting] need to support second coloring capabilities
diff --git a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/StructuredPresentationReconciler.java b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/StructuredPresentationReconciler.java index 0039d6b..c0c9447 100644 --- a/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/StructuredPresentationReconciler.java +++ b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/provisional/style/StructuredPresentationReconciler.java
@@ -708,9 +708,9 @@ private YUV_RGBConverter rgbConverter; private Map readOnlyColorTable; double readOnlyForegroundScaleFactor = 30; - - //private StructuredDocumentListener fDocumentListener = new StructuredDocumentListener(); + private IDocument fLastDocument; + /** * Creates a new presentation reconciler. There are no damagers or repairers * registered with this reconciler by default. The default partitioning @@ -1158,4 +1158,29 @@ return result; } + /** + * Constructs a "repair description" for the given damage and returns this + * description as a text presentation, essentially making + * {@link #createPresentation(IRegion, IDocument)} publicly callable. + * <p> + * NOTE: Should not be used if this reconciler is installed on a viewer. + * This method is considered EXPERIMENTAL and may not be available in + * subsequent versions. + * </p> + * + * @param damage + * the damage to be repaired + * @param document + * the document whose presentation must be repaired + * @return the presentation repair description as text presentation + */ + public TextPresentation createRepairDescription(IRegion damage, IDocument document) { + if (document != fLastDocument) { + setDocumentToDamagers(document); + setDocumentToRepairers(document); + fLastDocument= document; + } + return createPresentation(damage, document); + } + }