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>
This commit is contained in:
Brian Wilkerson 2019-01-05 19:25:47 +00:00 committed by commit-bot@chromium.org
parent 2f913e7c15
commit 18844b85ec
9 changed files with 30 additions and 28 deletions

View file

@ -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 @@ class AnalyzerImpl {
}
/// 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();

View file

@ -77,7 +77,7 @@ class AnalyzerWorkerLoop extends AsyncWorkerLoop {
/**
* 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 @@ class AnalyzerWorkerLoop extends AsyncWorkerLoop {
* 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 @@ class BuildMode with HasContextMixin {
*
* 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 @@ class BuildMode with HasContextMixin {
* 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 {

View file

@ -165,9 +165,7 @@ class Driver with HasContextMixin implements CommandLineStarter {
}
@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");
}

View file

@ -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 @@ abstract class CommandLineStarter {
* 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});
}

View file

@ -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 @@ class _Runner {
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");

View file

@ -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 @@ class TestAnalyzerWorkerLoop extends AnalyzerWorkerLoop {
: super(new MemoryResourceProvider(), connection);
@override
Future<Null> analyze(CommandLineOptions options, inputs) async {
Future<void> analyze(CommandLineOptions options, inputs) async {
if (_analyze != null) {
_analyze(options);
}

View file

@ -56,7 +56,7 @@ class BaseTest {
/// [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 @@ class BaseTest {
}
/// 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 @@ import 'package:aaa/a.dart';
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 @@ var b = new B();
});
}
Future<Null> _doDrive(String path,
Future<void> _doDrive(String path,
{String uri,
List<String> additionalArgs: const [],
String dartSdkSummaryPath}) async {
@ -748,17 +748,17 @@ linter:
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 @@ class OptionsTest extends BaseTest {
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');
}

View file

@ -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 @@ class _Runner {
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");

View file

@ -15,7 +15,7 @@ final String testDirectory = pathos.dirname(
/// 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()) {