use of org.eclipse.xtext.ui.validation.IResourceUIValidatorExtension in project xtext-eclipse by eclipse.
the class MarkerUpdaterImpl method processDelta.
private void processDelta(Delta delta, /* @Nullable */
ResourceSet resourceSet, IProgressMonitor monitor) throws OperationCanceledException {
URI uri = delta.getUri();
IResourceUIValidatorExtension validatorExtension = getResourceUIValidatorExtension(uri);
IMarkerContributor markerContributor = getMarkerContributor(uri);
CheckMode normalAndFastMode = CheckMode.NORMAL_AND_FAST;
for (Pair<IStorage, IProject> pair : mapper.getStorages(uri)) {
if (monitor.isCanceled()) {
throw new OperationCanceledException();
}
if (pair.getFirst() instanceof IFile) {
IFile file = (IFile) pair.getFirst();
if (EXTERNAL_PROJECT_NAME.equals(file.getProject().getName())) {
// skip the marker processing of that file, as the user can't react on any markers anyway.
continue;
}
if (delta.getNew() != null) {
if (resourceSet == null)
throw new IllegalArgumentException("resourceSet may not be null for changed resources.");
Resource resource = resourceSet.getResource(uri, true);
if (validatorExtension != null) {
validatorExtension.updateValidationMarkers(file, resource, normalAndFastMode, monitor);
}
if (markerContributor != null) {
markerContributor.updateMarkers(file, resource, monitor);
}
} else {
if (validatorExtension != null) {
validatorExtension.deleteValidationMarkers(file, normalAndFastMode, monitor);
} else {
deleteAllValidationMarker(file, normalAndFastMode, monitor);
}
if (markerContributor != null) {
markerContributor.deleteMarkers(file, monitor);
} else {
deleteAllContributedMarkers(file, monitor);
}
}
}
}
}
Aggregations