analyzer 0.26.1+9

The analysis package defines support for performing static analysis of Dart code. It was designed to support tooling efforts, but has also been used for such things as statistics gathering and code transformers.

If you are interested in providing Dart support in a long-running tool, such as an editor or IDE, you should use the analysis server instead of this package. The analysis server is currently shipped as an executable in the SDK and will be released as a package in the near future. In the meantime, if you'd like to learn more about it, please look at the Analysis Server API Specification or contact the mailing list (see below).

The API's in this package are, quite frankly, a mess at the moment. They were originally machine generated by a translator and were based on an earlier Java implementation. Several of the API's still look like their Java predecessors (or worse) rather than clean Dart API's.

In addition, there is currently no clean distinction between public and internal API's. We plan to address this issue soon, but doing so will, unfortunately, require a large number of breaking changes. We will try to minimize the pain this causes for our clients, but some pain is inevitable.

Questions and requests for additional functionality are welcome, and can be made by either opening an issue at or by emailing


  • OptionsProcessor extension point API changed to pass associated AnalysisContext instance into the optionsProcessed call-back.


  • Provisional (internal) plugin manifest parsing.


  • Plugin configuration ErrorHandler typedef API fix.


  • Provisional (internal) support for plugin configuration via .analysis_options.


  • Extension point for WorkManagerFactory(s).
  • Resolve enum documentation comments.
  • Fix display of parameter lists in servers Element structure (issue 24194)
  • Band-aid fix for issue #24191.


  • Removed a warning about importing unnamed libraries
  • Fix handling of empty URIs in .packages files (issue 24126)


  • Fix line starts in multiline comments (issue 23919).
  • Various small fixes to Windows path handling.
  • Update LineInfo computation during incremental resolution.
  • Make exclude list apply to contexts (issue 23941).
  • Fix type propagation for asynchronous for-in statements.
  • Fix ToStringVisitor for external functions (issue 23968).
  • Fix sorting of compilation unit members.
  • Add forwarding for DefaultFormalParameter metadata.
  • Fix most implementations of UriResolver.restoreAbsolute.
  • Disable dart2js hints by default.
  • Support older SDKs (Dart 1.11).


  • Add hook for listening to implicitly analyzed files
  • Add a PathFilter and AnalysisOptionsProvider utility classes to aid clients in excluding files from analysis when directed to do so by an options file.

  • API change: UriResolver.resolveUri(..) now takes an optional actualUri.
  • Change ResolutionCopier.visitAwaitExpression to copy *Type fields.
  • Fix highlight range for missing enum constant in switch (issue 23904).
  • Fix analyzer's treatment of ClassName?.staticMember to match spec.
  • Implement DEP 34 (less restricted mixins).
  • Fix some implementations of UriResolver.resolveUri(..) that did not properly handle the new actualUri argument.


  • Requires Dart SDK 1.12-dev or greater
  • Enable null-aware operators (DEP 9) by default.
  • Generic method support in the element model.


  • dart:sdk extension .sdkext changed to _sdkext (to play nicer with pub).


  • Initial support for analyzing dart:sdk extensions from .sdkext.


  • (Internal) code reorganization to address analysis warnings due to SDK reorg.
  • First steps towards .packages support.


  • Commandline interface moved to dedicated analyzer_cli package. Files moved:
  • bin/analyzer.dart
  • lib/options.dart
  • lib/src/analyzer_impl.dart
  • lib/src/error_formatter.dart
  • Removed dependency on the args package.


  • Changes in the async/await support.


New API:

  • Source.uri added.

Breaking changes:

  • DartSdk.fromEncoding replaced with fromFileUri.
  • Source.resolveRelative replaced with resolveRelativeUri.

1. Depend on it

Add this to your package's pubspec.yaml file:

  analyzer: "^0.26.1+9"

2. Install it

You can install packages from the command line:

$ pub get

Alternatively, your editor might support pub. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:analyzer/analyzer.dart';


Static analyzer for Dart.


Email Dart Team