parseFile method
void
parseFile(
- String inputPath
)
Implementation
void parseFile(String inputPath) {
final collection = AnalysisContextCollection(
includedPaths: <String>[path.absolute(path.normalize(inputPath))]);
for (final context in collection.contexts) {
for (final path in context.contextRoot.analyzedFiles()) {
final session = context.currentSession;
final result = session.getParsedUnit(path) as ParsedUnitResult;
if (result.errors.isEmpty) {
_collectUnit(result, path);
} else {
_collectError(result.errors);
}
}
}
_customTypeCache.addAll(_customTypeVisitor.results() +
[typeUniCallback, typeFlutterError, typeFuture]);
_uniAstVisitor.extendCustomType(_customTypeCache);
_unitMapTable.forEach((unit, inputFile) {
_uniAstVisitor.bind(inputFile, unit.toSource());
unit.accept(_uniAstVisitor);
});
}