mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix for 202085: CDT contributions to ProjectExplorer slows performance down dramatically
This commit is contained in:
parent
455f7fb132
commit
61c06f6e88
2 changed files with 34 additions and 24 deletions
|
@ -458,7 +458,11 @@ public class DeltaProcessor {
|
|||
IResource resource = delta.getResource();
|
||||
ICElement current = createElement(resource);
|
||||
updateChildren = updateCurrentDeltaAndIndex(current, delta);
|
||||
if (current == null || current instanceof ISourceRoot) {
|
||||
if (current == null) {
|
||||
nonCResourcesChanged(parent, delta);
|
||||
// no corresponding ICElement - we are done
|
||||
return;
|
||||
} else if (current instanceof ISourceRoot) {
|
||||
nonCResourcesChanged(parent, delta);
|
||||
} else if (current instanceof ICProject) {
|
||||
ICProject cprj = (ICProject)current;
|
||||
|
@ -467,9 +471,7 @@ public class DeltaProcessor {
|
|||
nonCResourcesChanged(parent, delta);
|
||||
}
|
||||
}
|
||||
if (current != null) {
|
||||
parent = current;
|
||||
}
|
||||
parent = current;
|
||||
} catch (CModelException e) {
|
||||
}
|
||||
if (updateChildren){
|
||||
|
|
|
@ -15,23 +15,6 @@ package org.eclipse.cdt.ui;
|
|||
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.ElementChangedEvent;
|
||||
import org.eclipse.cdt.core.model.IArchive;
|
||||
import org.eclipse.cdt.core.model.IBinary;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ICElementDelta;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.model.IElementChangedListener;
|
||||
import org.eclipse.cdt.core.model.IParent;
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.cdt.core.model.IWorkingCopy;
|
||||
import org.eclipse.cdt.internal.core.model.ArchiveContainer;
|
||||
import org.eclipse.cdt.internal.core.model.BinaryContainer;
|
||||
import org.eclipse.cdt.internal.ui.BaseCElementContentProvider;
|
||||
import org.eclipse.cdt.internal.ui.actions.SelectionConverter;
|
||||
import org.eclipse.cdt.internal.ui.text.CWordFinder;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.IResourceDelta;
|
||||
import org.eclipse.jface.text.IRegion;
|
||||
|
@ -45,6 +28,27 @@ import org.eclipse.jface.viewers.Viewer;
|
|||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.ui.texteditor.ITextEditor;
|
||||
|
||||
import org.eclipse.cdt.core.model.CModelException;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.model.ElementChangedEvent;
|
||||
import org.eclipse.cdt.core.model.IArchive;
|
||||
import org.eclipse.cdt.core.model.IBinary;
|
||||
import org.eclipse.cdt.core.model.ICElement;
|
||||
import org.eclipse.cdt.core.model.ICElementDelta;
|
||||
import org.eclipse.cdt.core.model.ICModel;
|
||||
import org.eclipse.cdt.core.model.ICProject;
|
||||
import org.eclipse.cdt.core.model.IElementChangedListener;
|
||||
import org.eclipse.cdt.core.model.IParent;
|
||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||
import org.eclipse.cdt.core.model.IWorkingCopy;
|
||||
|
||||
import org.eclipse.cdt.internal.core.model.ArchiveContainer;
|
||||
import org.eclipse.cdt.internal.core.model.BinaryContainer;
|
||||
|
||||
import org.eclipse.cdt.internal.ui.BaseCElementContentProvider;
|
||||
import org.eclipse.cdt.internal.ui.actions.SelectionConverter;
|
||||
import org.eclipse.cdt.internal.ui.text.CWordFinder;
|
||||
|
||||
/**
|
||||
* A content provider for C elements.
|
||||
* <p>
|
||||
|
@ -169,8 +173,10 @@ public class CElementContentProvider extends BaseCElementContentProvider impleme
|
|||
// well, we do see bugzilla 147694
|
||||
if (element instanceof ITranslationUnit) {
|
||||
ITranslationUnit unit = (ITranslationUnit) element;
|
||||
if (!getProvideWorkingCopy() && unit.isWorkingCopy()) {
|
||||
return;
|
||||
if (unit.isWorkingCopy()) {
|
||||
if (!getProvideWorkingCopy() || kind == ICElementDelta.REMOVED || kind == ICElementDelta.ADDED) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!getProvideMembers() && kind == ICElementDelta.CHANGED) {
|
||||
return;
|
||||
|
@ -230,8 +236,10 @@ public class CElementContentProvider extends BaseCElementContentProvider impleme
|
|||
if (deltas == null)
|
||||
return false;
|
||||
|
||||
if (deltas.length > 1) {
|
||||
if (deltas.length > 1 && !(parent instanceof ICModel)) {
|
||||
// more than one child changed, refresh from here downwards
|
||||
// but not if the parent is ICModel
|
||||
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=202085
|
||||
postRefresh(parent);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue