use of org.metaborg.core.resource.ResourceChange in project spoofax by metaborg.
the class FilesBuildState method sourceDiff.
private void sourceDiff(LanguageBuildState newState, Iterable<IdentifiedResourceChange> changes) {
for (IdentifiedResourceChange identifiedChange : changes) {
final ResourceChange change = identifiedChange.change;
switch(change.kind) {
case Create:
newState.source.add(change.resource);
break;
case Delete:
newState.source.remove(change.resource.getName());
break;
case Rename:
final FileObject from = change.from;
if (from != null) {
newState.source.remove(from.getName());
}
newState.source.add(change.to);
break;
case Copy:
newState.source.add(change.to);
break;
default:
break;
}
}
}
Aggregations