public class XtextReconciler
extends org.eclipse.core.runtime.jobs.Job
implements org.eclipse.jface.text.reconciler.IReconciler
IXtextDocument
's contents with the model in the underlying
XtextResource
.
Standard JFace Reconcilers, e.g. the MonoReconciler, convert an replace event into a delete and an insert
DirtyRegion. This leads to significant overhead, as DRs of different types cannot be merged, and the partial parsing
has to be performed for each DR in the queue. We overcome this situation by writing our own reconciler that only
creates ReplaceRegions which can always be merged, such that we have to call the partial parser only once.
Additionally, we simplify the reconciler by using the Job API.Modifier and Type | Class and Description |
---|---|
protected class |
XtextReconciler.DocumentListener |
protected class |
XtextReconciler.InputChangedDocumentEvent
A special
DocumentEvent that signals that an editors input has been replaced. |
protected class |
XtextReconciler.TextInputListener
Reconciles the entire document when the document in the viewer is changed.
|
Constructor and Description |
---|
XtextReconciler(XtextDocumentReconcileStrategy strategy) |
Modifier and Type | Method and Description |
---|---|
boolean |
belongsTo(java.lang.Object family) |
void |
forceReconcile() |
protected ReplaceRegion |
getAndResetReplaceRegion()
Deprecated.
no longer called by the framework. Use
getMergedReplaceRegion(XtextResource) instead. |
org.eclipse.jface.text.reconciler.IReconcilingStrategy |
getReconcilingStrategy(java.lang.String contentType) |
protected void |
handleInputDocumentChanged(org.eclipse.jface.text.IDocument oldInput,
org.eclipse.jface.text.IDocument newInput) |
void |
install(org.eclipse.jface.text.ITextViewer textViewer) |
protected void |
pause() |
protected void |
resume() |
protected org.eclipse.core.runtime.IStatus |
run(org.eclipse.core.runtime.IProgressMonitor monitor) |
void |
setDelay(int delay) |
void |
setEditor(XtextEditor editor) |
void |
setReconcilingStrategy(org.eclipse.jface.text.reconciler.IReconcilingStrategy strategy) |
void |
uninstall() |
addJobChangeListener, cancel, canceling, done, getJobManager, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, removeJobChangeListener, schedule, schedule, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, toString, wakeUp, wakeUp, yieldRule
@Inject public XtextReconciler(XtextDocumentReconcileStrategy strategy)
public org.eclipse.jface.text.reconciler.IReconcilingStrategy getReconcilingStrategy(java.lang.String contentType)
getReconcilingStrategy
in interface org.eclipse.jface.text.reconciler.IReconciler
public void setReconcilingStrategy(org.eclipse.jface.text.reconciler.IReconcilingStrategy strategy)
public void install(org.eclipse.jface.text.ITextViewer textViewer)
install
in interface org.eclipse.jface.text.reconciler.IReconciler
public void uninstall()
uninstall
in interface org.eclipse.jface.text.reconciler.IReconciler
protected void handleInputDocumentChanged(org.eclipse.jface.text.IDocument oldInput, org.eclipse.jface.text.IDocument newInput)
public void forceReconcile()
protected void pause()
protected void resume()
public void setDelay(int delay)
public boolean belongsTo(java.lang.Object family)
belongsTo
in class org.eclipse.core.runtime.jobs.Job
protected org.eclipse.core.runtime.IStatus run(org.eclipse.core.runtime.IProgressMonitor monitor)
run
in class org.eclipse.core.runtime.jobs.Job
@Deprecated protected ReplaceRegion getAndResetReplaceRegion()
getMergedReplaceRegion(XtextResource)
instead.public void setEditor(XtextEditor editor)