anchor.diff:  import 'package:analysis_server/src/status/pages.dart';
   import 'package:analyzer/dart/analysis/analysis_context_collection.dart';
   import 'package:analyzer/dart/analysis/results.dart';
  -import 'package:analyzer/file_system/file_system.dart';
   import 'package:analyzer/file_system/physical_file_system.dart';
   import 'package:analyzer/src/dart/analysis/byte_store.dart';
   import 'package:analyzer/src/generated/engine.dart';
  
positive.code: import 'metrics_util.dart';
  import 'visitors.dart';
  
  main() async {
    var analysisRoots = [''];
    await _computeCompletionMetrics(
        PhysicalResourceProvider.INSTANCE, analysisRoots);
  }
  
  /// When enabled, expected, but missing completion tokens will be printed to
  /// stdout.
  const bool _doPrintMissingCompletions = true;
  
  /// TODO(jwren) put the following methods into a class
  Future _computeCompletionMetrics(
      ResourceProvider resourceProvider, List<String> analysisRoots) async {
    int includedCount = 0;
    int notIncludedCount = 0;
    Counter completionKindCounter = Counter('completion kind counter');
    Counter completionElementKindCounter =
        Counter('completion element kind counter');
  
    for (var root in analysisRoots) {
      print('Analyzing root: \"$root\"');
  
      if (!io.Directory(root).existsSync()) {
        print('\tError: No such directory exists on this machine.\n');
        continue;
      }
  
      final collection = AnalysisContextCollection(
        includedPaths: [root],
        resourceProvider: resourceProvider,
      );
  
      for (var context in collection.contexts) {
        var declarationsTracker =
            DeclarationsTracker(MemoryByteStore(), resourceProvider);
        declarationsTracker.addContext(context);
  
        while (declarationsTracker.hasWork) {
  
negative.code:             resolvedUnitResult.unit.accept(visitor);
  
              for (var expectedCompletion in visitor.expectedCompletions) {
                var suggestions = await _computeCompletionSuggestions(
                    resolvedUnitResult,
                    expectedCompletion.offset,
                    declarationsTracker);
  