use of org.eclipse.jface.text.reconciler.DirtyRegion in project webtools.sourceediting by eclipse.
the class ReconcileStepForValidator method validate.
protected IReconcileResult[] validate(DirtyRegion dirtyRegion, IRegion subRegion) {
IReconcileResult[] results = EMPTY_RECONCILE_RESULT_SET;
IFile file = getFile();
try {
IncrementalHelper helper = getHelper(file != null ? file.getProject() : null);
/*
* Setting the URI isn't necessary for all source validators, we
* can still continue without it
*/
if (file != null && file.exists()) {
helper.setURI(file.getFullPath().toString());
}
if (fValidator instanceof ISourceValidator) {
IncrementalReporter reporter = getReporter();
if (getScope() == IReconcileAnnotationKey.PARTIAL)
((ISourceValidator) fValidator).validate(dirtyRegion, helper, reporter);
else
((ISourceValidator) fValidator).validate(new Region(0, getDocument().getLength()), helper, reporter);
/*
* call IValidator.cleanup() during release() because this
* validator might be called again on a different region
*/
results = createAnnotations(reporter.getAnnotationInfo());
reporter.removeAllMessages(fValidator);
}
} catch (Exception e) {
Logger.logException(e);
}
return results;
}
Aggregations