import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
+import org.simantics.scl.compiler.errors.Locations;
import org.simantics.scl.compiler.module.debug.SymbolReference;
import org.simantics.scl.ui.editor2.OpenDeclaration;
import org.simantics.scl.ui.editor2.OpenSCLDefinition;
}
- private static final ViewerComparator comparator = new ViewerComparator((o1, o2) -> o1.compareTo(o2));
+ private static final ViewerComparator comparator = new ViewerComparator() {
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ SymbolReference r1 = (SymbolReference)e1;
+ SymbolReference r2 = (SymbolReference)e2;
+ int c = r1.referrer.toString().compareTo(r2.referrer.toString());
+ if (c != 0) {
+ return c;
+ } else {
+ return Integer.compare(Locations.beginOf(r1.referenceLocation), Locations.beginOf(r2.referenceLocation));
+ }
+ }
+ };
@Override
protected void configureTreeViewer(TreeViewer viewer) {