use of org.eclipse.xtext.validation.IssueSeveritiesProvider in project xtext-eclipse by eclipse.
the class DerivedResourceMarkerCopier method getMaxSeverity.
private int getMaxSeverity(IFile srcFile) {
URI resourceURI = URI.createPlatformResourceURI(srcFile.getFullPath().toString(), true);
IResourceServiceProvider serviceProvider = serviceProviderRegistry.getResourceServiceProvider(resourceURI);
if (serviceProvider == null)
return Integer.MAX_VALUE;
IssueSeveritiesProvider severitiesProvider = serviceProvider.get(IssueSeveritiesProvider.class);
Severity severity = severitiesProvider.getIssueSeverities(new ResourceImpl(resourceURI)).getSeverity(COPY_JAVA_PROBLEMS_ISSUECODE);
switch(severity) {
case WARNING:
return IMarker.SEVERITY_WARNING;
case ERROR:
return IMarker.SEVERITY_ERROR;
case INFO:
case IGNORE:
return Integer.MAX_VALUE;
default:
break;
}
return Integer.MAX_VALUE;
}
Aggregations