use of org.eclipse.xtext.ui.editor.quickfix.WorkbenchMarkerResolutionAdapter in project xtext-eclipse by eclipse.
the class AbstractQuickfixTest method applyQuickfixOnMultipleMarkers.
protected void applyQuickfixOnMultipleMarkers(IMarker[] markers) {
MarkerResolutionGenerator generator = getInjector().getInstance(MarkerResolutionGenerator.class);
IMarker primaryMarker = markers[0];
IMarkerResolution[] resolutions = generator.getResolutions(primaryMarker);
Assert.assertEquals(1, resolutions.length);
assertTrue(resolutions[0] instanceof WorkbenchMarkerResolutionAdapter);
WorkbenchMarkerResolutionAdapter resolution = (WorkbenchMarkerResolutionAdapter) resolutions[0];
List<IMarker> others = Lists.newArrayList(resolution.findOtherMarkers(markers));
assertFalse(others.contains(primaryMarker));
assertEquals(markers.length - 1, others.size());
others.add(primaryMarker);
resolution.run(others.toArray(new IMarker[others.size()]), new NullProgressMonitor());
}
Aggregations