use of org.eclipse.xtext.ui.validation.MarkerTypeProvider in project xtext-eclipse by eclipse.
the class DerivedResourceMarkerCopier method determinateMarkerTypeByURI.
private String determinateMarkerTypeByURI(SourceRelativeURI resourceURI) {
IResourceServiceProvider serviceProvider = serviceProviderRegistry.getResourceServiceProvider(resourceURI.getURI());
if (serviceProvider == null)
return null;
MarkerTypeProvider typeProvider = serviceProvider.get(MarkerTypeProvider.class);
Issue.IssueImpl issue = new Issue.IssueImpl();
issue.setType(CheckType.NORMAL);
return typeProvider.getMarkerType(issue);
}
use of org.eclipse.xtext.ui.validation.MarkerTypeProvider in project n4js by eclipse.
the class OwnResourceValidatorAwareValidatingEditorCallback method newValidationJob.
private ValidationJob newValidationJob(final XtextEditor editor) {
final IXtextDocument document = editor.getDocument();
final IAnnotationModel annotationModel = editor.getInternalSourceViewer().getAnnotationModel();
final IssueResolutionProvider issueResolutionProvider = getService(editor, IssueResolutionProvider.class);
final MarkerTypeProvider markerTypeProvider = getService(editor, MarkerTypeProvider.class);
final MarkerCreator markerCreator = getService(editor, MarkerCreator.class);
final IValidationIssueProcessor issueProcessor = new CompositeValidationIssueProcessor(new AnnotationIssueProcessor(document, annotationModel, issueResolutionProvider), new MarkerIssueProcessor(editor.getResource(), markerCreator, markerTypeProvider));
return editor.getDocument().modify(resource -> {
final IResourceServiceProvider serviceProvider = resource.getResourceServiceProvider();
final IResourceValidator resourceValidator = serviceProvider.getResourceValidator();
return new ValidationJob(resourceValidator, editor.getDocument(), issueProcessor, ALL);
});
}
Aggregations