use of org.eclipse.xtext.ide.serializer.impl.EObjectDescriptionDeltaProvider.Delta in project xtext-core by eclipse.
the class ReferenceUpdater method findContainingDelta.
public Delta findContainingDelta(Deltas deltas, EObject obj) {
EObject current = obj;
while (current != null) {
Delta delta = deltas.getDelta(current);
if (delta != null && delta.hasSimpleNameOrUserdataChanged()) {
return delta;
}
current = current.eContainer();
}
return null;
}
use of org.eclipse.xtext.ide.serializer.impl.EObjectDescriptionDeltaProvider.Delta in project xtext-core by eclipse.
the class ReferenceUpdater method needsUpdating.
protected boolean needsUpdating(IReferenceUpdaterContext context, IUpdatableReference ref) {
QualifiedName fqn = getQualifiedName(ref);
if (fqn == null) {
return false;
}
EObject target = ref.getTargetEObject();
Deltas deltas = context.getEObjectDescriptionDeltas();
Delta delta = deltas.getDelta(target);
if (delta != null && !containsReferenceText(delta, fqn)) {
return true;
}
Delta targetDelta = findContainingDelta(deltas, target);
if (targetDelta != null && targetDelta.getObject() == target) {
return true;
}
Delta sourceDelta = findContainingDelta(deltas, ref.getSourceEObject());
return !Objects.equal(sourceDelta, targetDelta);
}
Aggregations