if (errorListener.getErrorReported()) {
return;
}
// Produce an updated AST
IncrementalParser parser = new IncrementalParser(
cache.getSource(),
scanner.getTokenMap(),
AnalysisErrorListener.NULL_LISTENER);
updatedUnit = parser.reparse(
cache.getResolvedUnit(),
scanner.getLeftToken(),
scanner.getRightToken(),
cache.getOffset(),
cache.getOffset() + cache.getOldLength());
// Update the resolution
TypeProvider typeProvider = getTypeProvider();
if (updatedUnit != null && typeProvider != null) {
CompilationUnitElement element = updatedUnit.getElement();
if (element != null) {
LibraryElement library = element.getLibrary();
if (library != null) {
IncrementalResolver resolver = new IncrementalResolver(
library,
cache.getSource(),
typeProvider,
errorListener);
resolver.resolve(parser.getUpdatedNode());
}
}
}
}