compilationUnitFor abstract method

Future<CompilationUnit> compilationUnitFor(
  1. AssetId assetId,
  2. {bool allowSyntaxErrors = false}
)

Returns a parsed AST structor representing the file defined in assetId.

This is a much cheaper api compared to libraryFor, because it will only parse a single file and does not give you a resolved element model.

Implementation

Future<CompilationUnit> compilationUnitFor(AssetId assetId,
    {bool allowSyntaxErrors = false});