package org.simantics.scl.ui.search;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider;
import org.eclipse.jface.viewers.DecorationContext;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
import org.eclipse.jface.viewers.IColorProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
import org.eclipse.search.ui.text.AbstractTextSearchResult;
import org.eclipse.search.ui.text.AbstractTextSearchViewPage;
import org.eclipse.search.ui.text.Match;
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;
public class SCLSearchResultPage extends AbstractTextSearchViewPage {
Set<Object> toRemove= new HashSet<>();
Set<Object> toUpdate= new HashSet<>();
Map<Object, Set<Object>> toAdd= new HashMap<>();
+
+ // TODO: Clear this for now at this point but probably this has some
+ // side-effects once nested children can be shown, never?
+ for (Entry<Object, Set<Object>> e : fChildrenMap.entrySet()) {
+ Collection<Object> refs = (Collection<Object>) e.getValue();
+ refs.forEach(r -> {
+ remove(toRemove, toUpdate, r);
+ });
+ }
+
+
for (int i= 0; i < updatedElements.length; i++) {
if (getPage().getDisplayedMatchCount(updatedElements[i]) > 0)
insert(toAdd, toUpdate, updatedElements[i]);