Remove occurrences of Future<Null> from analyzer_cli
Change-Id: I008589455681dd5da80df4e466803f8cf48cd910
Reviewed-on: https://dart-review.googlesource.com/c/88435
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
diff --git a/pkg/analyzer_cli/lib/src/analyzer_impl.dart b/pkg/analyzer_cli/lib/src/analyzer_impl.dart
index e36008f..617bdf9 100644
--- a/pkg/analyzer_cli/lib/src/analyzer_impl.dart
+++ b/pkg/analyzer_cli/lib/src/analyzer_impl.dart
@@ -1,9 +1,7 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library analyzer_cli.src.analyzer_impl;
-
import 'dart:async';
import 'dart:io';
@@ -122,7 +120,7 @@
}
/// Fills [errorInfos] using [files].
- Future<Null> prepareErrors() async {
+ Future<void> prepareErrors() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
PerformanceTag previous = _prepareErrorsTag.makeCurrent();
diff --git a/pkg/analyzer_cli/lib/src/build_mode.dart b/pkg/analyzer_cli/lib/src/build_mode.dart
index 7508eee..2c64108 100644
--- a/pkg/analyzer_cli/lib/src/build_mode.dart
+++ b/pkg/analyzer_cli/lib/src/build_mode.dart
@@ -77,7 +77,7 @@
/**
* Performs analysis with given [options].
*/
- Future<Null> analyze(
+ Future<void> analyze(
CommandLineOptions options, Map<String, WorkerInput> inputs) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
@@ -147,7 +147,7 @@
* Run the worker loop.
*/
@override
- Future<Null> run() async {
+ Future<void> run() async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
errorSink = errorBuffer;
@@ -472,7 +472,7 @@
*
* Otherwise compute it and store into the [uriToUnit] and [assembler].
*/
- Future<Null> _prepareUnlinkedUnit(String absoluteUri) async {
+ Future<void> _prepareUnlinkedUnit(String absoluteUri) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
// Maybe an input package contains the source.
@@ -497,7 +497,7 @@
* Print errors for all explicit sources. If [outputPath] is supplied, output
* is sent to a new file at that path.
*/
- Future<Null> _printErrors({String outputPath}) async {
+ Future<void> _printErrors({String outputPath}) async {
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
await logger.runAsync('Compute and print analysis errors', () async {
diff --git a/pkg/analyzer_cli/lib/src/driver.dart b/pkg/analyzer_cli/lib/src/driver.dart
index 41a285e..8b2b808 100644
--- a/pkg/analyzer_cli/lib/src/driver.dart
+++ b/pkg/analyzer_cli/lib/src/driver.dart
@@ -165,9 +165,7 @@
}
@override
- Future<Null> start(List<String> args, {SendPort sendPort}) async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
+ Future<void> start(List<String> args, {SendPort sendPort}) async {
if (analysisDriver != null) {
throw new StateError("start() can only be called once");
}
diff --git a/pkg/analyzer_cli/lib/starter.dart b/pkg/analyzer_cli/lib/starter.dart
index 4caa91f..09db5bf 100644
--- a/pkg/analyzer_cli/lib/starter.dart
+++ b/pkg/analyzer_cli/lib/starter.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -40,5 +40,5 @@
* If [sendPort] is provided it is used for bazel worker communication
* instead of stdin/stdout.
*/
- Future<Null> start(List<String> arguments, {SendPort sendPort});
+ Future<void> start(List<String> arguments, {SendPort sendPort});
}
diff --git a/pkg/analyzer_cli/test/analysis_options_test.dart b/pkg/analyzer_cli/test/analysis_options_test.dart
index b04f1a4..e8bd10a 100644
--- a/pkg/analyzer_cli/test/analysis_options_test.dart
+++ b/pkg/analyzer_cli/test/analysis_options_test.dart
@@ -1,3 +1,7 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
import 'dart:async';
import 'dart:io';
@@ -71,7 +75,7 @@
String get stdout => _stdout.toString();
- Future<Null> run2(List<String> args) async {
+ Future<void> run2(List<String> args) async {
await new Driver(isTesting: true).start(args);
if (stderr.isNotEmpty) {
fail("Unexpected output to stderr:\n$stderr");
diff --git a/pkg/analyzer_cli/test/build_mode_test.dart b/pkg/analyzer_cli/test/build_mode_test.dart
index 90655ef..25e884f 100644
--- a/pkg/analyzer_cli/test/build_mode_test.dart
+++ b/pkg/analyzer_cli/test/build_mode_test.dart
@@ -1,9 +1,7 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library analyzer_cli.test.built_mode;
-
import 'dart:async';
import 'package:analyzer/file_system/memory_file_system.dart';
@@ -32,7 +30,7 @@
: super(new MemoryResourceProvider(), connection);
@override
- Future<Null> analyze(CommandLineOptions options, inputs) async {
+ Future<void> analyze(CommandLineOptions options, inputs) async {
if (_analyze != null) {
_analyze(options);
}
diff --git a/pkg/analyzer_cli/test/driver_test.dart b/pkg/analyzer_cli/test/driver_test.dart
index 23a2841..aa44888 100644
--- a/pkg/analyzer_cli/test/driver_test.dart
+++ b/pkg/analyzer_cli/test/driver_test.dart
@@ -56,7 +56,7 @@
/// [args] and an [options] file path. The value of [options] defaults to an
/// empty options file to avoid unwanted configuration from an otherwise
/// discovered options file.
- Future<Null> drive(
+ Future<void> drive(
String source, {
String options: emptyOptionsFile,
List<String> args: const <String>[],
@@ -65,7 +65,7 @@
}
/// Like [drive], but takes an array of sources.
- Future<Null> driveMany(
+ Future<void> driveMany(
List<String> sources, {
String options: emptyOptionsFile,
List<String> args: const <String>[],
@@ -211,7 +211,7 @@
var b = a;
''');
- Future<Null> buildUnlinked(String uri, String path, String output) async {
+ Future<void> buildUnlinked(String uri, String path, String output) async {
await _doDrive(path, uri: uri, additionalArgs: [
'--build-summary-only',
'--build-summary-only-unlinked',
@@ -485,7 +485,7 @@
});
}
- Future<Null> _doDrive(String path,
+ Future<void> _doDrive(String path,
{String uri,
List<String> additionalArgs: const [],
String dartSdkSummaryPath}) async {
@@ -748,17 +748,17 @@
YamlMap _parseOptions(String src) =>
new AnalysisOptionsProvider().getOptionsFromString(src);
- Future<Null> _runLinter_defaultLints() async {
+ Future<void> _runLinter_defaultLints() async {
await drive('data/linter_project/test_file.dart',
options: 'data/linter_project/$optionsFileName', args: ['--lints']);
}
- Future<Null> _runLinter_lintsInOptions() async {
+ Future<void> _runLinter_lintsInOptions() async {
await drive('data/linter_project/test_file.dart',
options: 'data/linter_project/$optionsFileName', args: ['--lints']);
}
- Future<Null> _runLinter_noLintsFlag() async {
+ Future<void> _runLinter_noLintsFlag() async {
await drive('data/no_lints_project/test_file.dart',
options: 'data/no_lints_project/$optionsFileName');
}
@@ -917,7 +917,7 @@
expect(outSink.toString(), contains("1 error and 1 warning found."));
}
- Future<Null> _driveBasic() async {
+ Future<void> _driveBasic() async {
await drive('data/options_tests_project/test_file.dart',
options: 'data/options_tests_project/$optionsFileName');
}
diff --git a/pkg/analyzer_cli/test/package_prefix_test.dart b/pkg/analyzer_cli/test/package_prefix_test.dart
index a85fc16..61ae3b4 100644
--- a/pkg/analyzer_cli/test/package_prefix_test.dart
+++ b/pkg/analyzer_cli/test/package_prefix_test.dart
@@ -1,3 +1,7 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
import 'dart:async';
import 'dart:io' show exitCode;
@@ -60,7 +64,7 @@
String get stdout => _stdout.toString();
- Future<Null> run2(List<String> args) async {
+ Future<void> run2(List<String> args) async {
await new Driver(isTesting: true).start(args);
if (stderr.isNotEmpty) {
fail("Unexpected output to stderr:\n$stderr");
diff --git a/pkg/analyzer_cli/test/utils.dart b/pkg/analyzer_cli/test/utils.dart
index 3d91aef..b12c19e 100644
--- a/pkg/analyzer_cli/test/utils.dart
+++ b/pkg/analyzer_cli/test/utils.dart
@@ -15,7 +15,7 @@
/// Recursively copy the specified [src] directory (or file)
/// to the specified destination path.
-Future<Null> recursiveCopy(FileSystemEntity src, String dstPath) async {
+Future<void> recursiveCopy(FileSystemEntity src, String dstPath) async {
if (src is Directory) {
await (new Directory(dstPath)).create(recursive: true);
for (FileSystemEntity entity in src.listSync()) {